I am running Windows 7 RTM. PowerShell 2.0 is installed by default. I am using the excellent Windows PowerShell ISE to edit my scripts. I have the following script:
I've solved the problem. I've corrected the description of the problem to make it accurate.
The source of the problem is that I was incorrectly using the Param keyword multiple times. The correct usage is to declare multiple parameters within a single Param declaration like the following:
Param($p, $d)
This usage is explained in the Windows PowerShell Help article "about_Functions".