Getting "Can't find the drive. The drive called 'IIS' does not exist."
The drive is provided by the WebAdministration
module, so you need to install/import that module first.
How you install the module depends on your actual system and whether you use GUI or PowerShell. On a Windows Server 2008 R2 for instance you'd install the module with the following PowerShell commands:
Import-Module ServerManager
Add-WindowsFeature Web-Scripting-Tools
After the module is installed you can load it in your script like this:
Import-Module WebAdministration
To resolve running the script (or powershell shell/exe) in Admin mode.
On Windows Server 2008 32-bit, I had to explicitly download and install "IIS Powershell Snap-in (x86)" from Microsoft's website.