So the install is easy enough, typical /quiet /passive /norestart switches for a windows "update" package.
The devil here is in the details. By default the .ps1 file type is assigned to open in notepad, if you are like me and want to supplant VBScript then being able to double click the files (or run them easily from the command line) is vital.
#Configure code signing, this allows anything NOT downloaded from the internet to run without being signed.
"C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe" Set-ExecutionPolicy RemoteSigned
#A word of warning, this only blocks files downloaded via an AES participant, like IE and Outlook Express. More details here: http://blogs.msdn.com/powershell/archive/2007/03/07/how-does-the-remotesigned-execution-policy-work.aspx
Now you can finish the job by running a .ps1 file itself. In order to do so you have to run it like so:
powershell.exe "&'C:\Path to script\script.ps1'"
It's annoying and dumb but that's what we are here to fix.
Now you should no longer have crappy text file icons for your .ps1 files, it will open the files when double clicked or run from the command prompt (still have to use full path names, it's a "feature" meant to make trojan attacks harder so, indicators are we will just have to live with it).
We've also deleted the Start Menu shortcut because if you, like me, are looking to roll this out to every machine in the company, we want it to be like VBScript...in other words, we don't even want the user to know or care that it's there.
One note here is that the icon change DOES take effect, but since I don't know what MS does to trigger a refresh, it wont show up till you reboot (or some other action comes along and kicks off a refresh).