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
For those on windows server 2016 and 2019 I found that it was the Server Feature
IIS Management Console aka Web-Mgmt-Console
that needed to be turned on. If you are in an active powershell session and have import the WebAdministration module and the command
Get-PSDrive
does not return IIS in the list. Run the following
Remove-Module WebAdministration
Import-Module WebAdministration
Get-PSDrive
Then you should see the powershell IIS drive. I suspect my issue had to do with running scripts that imported WebAdministration but were attaching the PSDrive IIS in my powershell session. Attempts to import WebAdministration again would not attaching the PSDrive to my session unless I removed it first.