I’m trying to make form in Powershell to prompt idle users with a pending logoff, that can be used across multiple IT departments and can be changed to meet their needs. Specifically, they can change the presented logoff message by changing a registry value.
The problem I’m having is with “Location” for the different pieces of the form. Currently we are changing the location as below,
$btnOk.Location = new-object System.Drawing.Size(170, 175)
This works fine for our test message text, however if a different department wants to customize the message, or if they want to make the message longer it would mess up the formatting.
I’m wondering if there is any way to specify alignment on the text, so I can specify say “Y=170,X=Center” so that the text is at a specific height, but the message will always be centered on the form.
Kind of a powershell noob. Thanks for anyone who can help.