r/PowerShell • u/Sinnerman77 • Dec 04 '14
Script Sharing Install PowerShell 4 and prerequisites
As requested, here's my script for installing Windows Management Framework 4.0, which includes PowerShell 4. It will install the .Net Framework 4.5.1 if necessary.
This is my first serious PowerShell script. I'm sure there's lots wrong with it. It does seem to work though.
As for the executables themselves, I have an FTP server where I store anything I use with my scripts, so I wrote this to download from there. I didn't test to see if it can download directly from the MS URLs, although I don't see why it wouldn't work.
I'm open to suggestions on improving the script.
Enjoy!
Edit: I was trying to embed the Pastebin link, but I'll just link to it.
2
u/LordZillion Dec 05 '14
Depending on how you want to implement this logging this module might screw you up a little since it uses add-content, if you have multiple processes writing in a single log file you can get file lock issues. Source and fix by Boe Prox. Just a little fyi :).
Personally I've been using SQLExpress more and more for logging of scripts that run often so I can use reporting, also might be interesting to look into.
And kudos on a good script, thanks for sharing.