Snippet: Getting stuff installed

I sent this little snippet around my team after my aforementioned PowerShell Ninjas training session. It’s an easy way to get a bit of software painlessly installed onto someone’s machine. I just said “Hey, if you need the Powershell commuity extensions, just run this in your powershell prompt”

iex((iwr http://devops.fixt.co/posh/install-pscx.txt).Content)

And now my team have PSCX installed, via this little snippet. There are of course some considerations to be made here. It’s not going to work without having unrestricted scripting permissions, and it might not be great to get your users into the habit of running random code off the internet, but hey, Chocolatey do it, so why can’t you?

This is actually a great technique for power scripters to make your modules and profiles portable. Get them on a server you trust, run a one-liner, hey presto you have a fully configured environment, ready to use. Neat.

Leave a Reply

Your email address will not be published. Required fields are marked *