• Comparing the files in two directories with Powershell

    If you've got yourself in a bit of a mess while copying files from one place to another, or if you've got a poor person's backup of stuff in another directory then you might want to compare two folders to see if they contain the same files.

    The Compare-Object cmdlet lets you do this. Here is a simple example to compare the files in two directories based just on the file name.

    compare-object -referenceobject (get-childitem -recurse  | where { ! $_.PSIsContainer }) -differenceobject (get-childitem 'D:\simple-backup' -recurse  | where { ! $_.PSIsContainer }) -Property Name

  • Renaming lots of images quickly

    This isn't really a project, but it's been a problem that's bugged me for a while. When I download lots of pictures from my camera, how can I rename them all to something more suitable than IMG_0564.

    I like to give my camera pictures a descriptive name followed by a number if it's one of a set. I've wasted a lot of time in the past renaming them all by hand. This morning I finally got round to working out a better and much quicker way.

    There will be lots of ways to do this, but I've wanted to try a language called Powershell for a while. Powershell is an extension to Windows and is like DOS, …