Tim Murphy's .NET Software Architecture Blog

PowerShell

What If All Scripts Supported WhatIf

In a previous post I described a PowerShell script that I created for renaming image files. The other day I mistakenly put in an incorrect value for one of the command line parameters. At that point I realized that maybe my script needed the same capability that many of the PowerShell cmdlets have. It is a parameter called "whatIf". whatIf is a parameter that cmdlets with a destructive nature make available in order to allow you to verify that your script will work as you intended before committing ......

Renaming Groups of Files With PowerShell

One of my hobbies is photography. Naming image files so that they are useful can take a significant amount of time. Personally I like to name them by subject and by date so that they sequence nicely in Windows Explorer. I'm sure there are hundreds of application that already have this feature, but being a geek and wanting to lean something new I decided to figure out how to perform the task in PowerShell. The first thing I needed to figure out was how to select a group of files. I found that the ......