Geeks With Blogs
Caffeinated Coder A Grande, Triple Shot, Non-Fat Core Dump by Russell Ball

One of my goals for the next six months was to contribute to an open source project and I think I've chosen one. I downloaded and installed the PowerShell Community Extensions (a.k.a. pscx) from codeplex a while ago, but I just now got around to really tinkering with the cmdLets and reviewing the source code and scripts. I have to say I'm impressed. Keith Hill and his team of volunteer developers did a first rate job of supplementing version one of Powershell with some really useful cmdlets. I can't wait to dig into the source code some more and figure out how the snap-in model works.

Here are a few of my favorite features:

Provider:

  • GAC Provider - It's a little slow when it first loads up, but it is very helpful to be able to easily navigate around in the GAC and do wildcard searches on version numbers.

CmdLets

  • Get/Stop-TerminalSession - It seems like every couple of weeks I have to kill a remote terminal services connection on one of our development servers because someone forgot to log off and pushed us over the two simultaneous users limit. This cmdlet is a lot quicker than loading up the administrative GUI and will help make the experience much less aggravating.
  • Write-Zip - This will be very useful addition to backup/archiving scripts. At home, I just did the following: dir "G:\Music\Radiohead\Pablo Honey" | write-zip
  • Get-FileVersionInfo - We just started auto-versioning all of our dll's during our build process and set it up so we can match the version of a dll in production with a build directory on our build server. I'm sure we'll be asked to create some automated way to help auditors figure out the version numbers and this will definitely help. 
  • Set-Writeable - This just removes the Read-Only flag from files, but it would have come in handy last year when we had to upgrade several projects to the 2.0 framework and move them from VSS to TFS. Removing a project from VSS is painful and one of the more tedious steps is clearing the read-only flag on all the source files. I remember wasting an hour of my life writing and debugging a VBScript because the right-click/recursive method never seemed to fully work.
  • Out-Clipboard - One of the things that still sucks about working in the shell environment is the editing capabilities, especially when it comes to copy and pasting. When I want to transfer the results of a command to an email or word doc, I simply pipe it to this cmdlet.
  • Send-Smtp - This will be great for the error-handling notification part of scripts. It would be even better if I could figure out how to populate the body parameter from the pipeline.

You can get a list of the 59 new cmdLets added when installing this snap-in by calling the function gcmpscx.

Posted on Thursday, July 26, 2007 11:38 PM Technical How-To's | Back to top


Comments on this post: The Open Source Side of Powershell: PSCX

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Russell Ball | Powered by: GeeksWithBlogs.net