当我运行此PowerShell脚本时
Import-Module WebAdministration
$path1 = Get-ItemProperty -PSPath IIS:\Sites\CompassSvcQA-Red\R4\CompassSettings
Set-Location "C:\Windows\Microsoft.NET\Framework\v4.0.30319"
.\aspnet_regiis.exe -pef "connectionStrings" $path1.physicalPath -prov "DataProtectionConfigurationProvider"
我收到此错误:
Get-ItemProperty : Cannot find drive. A drive with the name 'IIS' does not exist. At line:2 char:10 + $path1 = Get-ItemProperty -PSPath IIS:\Sites\CompassSvcQA-Red\R4\CompassSettings + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (IIS:String) [Get-ItemProperty], DriveNotFoundException + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand