I was recently asked to add some logic to our old vbs logon script, but since the old one had a lot of unused functions and needed a rewrite anyway I decided to try to rewrite it in PowerShell. Since I wanted to give some user feedback when something went wrong I need a function to present data. First of all I wrote the script and got it working just as I wanted, but when I then applied it as a logon script it did not behave in the same way any more. I still don’t why it behaves the way it does but I will present my findings and the workarounds I found. Since I wanted to format the output to the user and also needed the form to be “topmost” I decided to go with the “Forms” assembly instead of MessageBox.
↧