Sunday, December 4, 2011

Powershell, pretty cool afterall

I am really enjoying Powershell.  The ISE is much more useful than I thought and flipping from the shell to notepad is really slick (although I still had to install gVim).  The cmdlets are slicker than I originally gave them credit for.  The default is to list all of the parameters/attributes of the cmdlet I've been experimenting and you can almost always leave them off when there's just one or two parameters.  e.g.

PS > Get-History | Foreach-Object { $_.CommandLine } > c:\temp\
script.ps1
For the exact same results - try the much easier to remember...

PS > get-history > history.txt 
The above works just like you would expect.

I found quite a few other examples that were obviously simplified.  It's a pretty interesting scripting language.  By adding the .Net accessibility, it is as if you have blended Bash and Ruby and some special Windows references thrown in to boot.  I like it.  It looks to be very powerful and handy.  One of the main reasons I didn't like administering Windows is the lack of good sysadmin scripting tools and a poor command line shell.  Powershell fixes that.  Much is familiar too since it uses many Bash commands.

So, I've spent the day patching and armoring my Windows 7 running under OpenBox.  I really like Windows 7 (which is probably why they are coming out with a Windows 8 so soon.)  

With the vastly improved Windows 7, Windows 2008 R2 and Powershell - all in 64 bit - looks like it's going to be a less painful transition that I had thought.  I'm actually really looking forward to it now.