PostHeaderIcon PowerShell and iTunes

PowerShell is Microsoft’s CMD.exe replacement. It is a very powerful shell that does an excellent job of bridging the gap of the DOS command line, COM objects, vbscript, and .NET. It is hard to describe it’s capabilities. You really have to experience it for yourself and have your own epiphany.

For my first PowerShell script I decided to replace the combo batch file and javascript file that I currently use to load all of the podcasts that I subscribe to into my iTunes. The old way was to run the batch file which scanned a folder and all subfolders looking for files with the archive bit set. For each file that it found it would then call the javascript file, which would load the one file into iTunes. The whole process was kind of crude. It would load any file modified in that subfolder. The files would sometimes include jpg or pdf files or even partial downloads.

Using Powershell I was able to easily include in one script the recursing of the folder structure for files with the archive bit set, selection by file extension, and calling the iTunes COM object api. It works quite well.

I basically have a server that runs Juice 24 hours a day collecting podcasts. When I get ready to synch my iPod I just run the PowerShell script and iTunes is updated. I have smart playlists that automatically organize the podcasts when they are loaded.

For links to the script and a detailed explanation go here.

Leave a Reply

You must be logged in to post a comment.