Getting “Can't find the drive. The drive called 'IIS' does not exist.”

前端 未结 5 1124
北恋
北恋 2020-12-01 17:45

I wrote a PowerShell script to deploy IIS Website automatically, but when I pass parameters to the script I get the following error:

Cannot find the d

5条回答
  •  既然无缘
    2020-12-01 18:22

    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
    

提交回复
热议问题