Sunday, April 15, 2007

PowerShell: Alternative to VBScript and DOS Scripts

Most developers I know still use VBScript and DOS to compose reusable and one-time scripts. I was one of these people until I discovered PowerShell. It's a bit tricky to pick up but far more powerful than the legacy alternatives.

My favorite feature is the "-whatIf" flag found on most (if not all) operations. One can set this flag to understand exactly what would happen if you were to execute the command as it is written. It's almost like having a unit test harness for scripting operations. No more accidental hard drive formatting.

So, for your next scripting task, check out PowerShell instead of writing some hard-to-maintain/author legacy script.

No comments: