远程执行设置physicalPath
出错,并显示以下消息:
找不到驱动器。名为“IIS”的驱动器不存在。
以下有什么问题?
$site = Read-Host "What is the name of the virtual?"
$newpath = Read-Host "What is the NEW PATH of the new site?"
$ScriptBlockContent = {
$site = $args[0],
$newpath = $args[0]
(Set-ItemProperty -Path IIS:\\Sites\ABC_LIVE\$site -Name "physicalPath" -Value "$newpath")
}
# Add the IIS PowerShell Module
Import-Module WebAdministration
Invoke-Command -ComputerName DEVSERVERNAME -ScriptBlock $ScriptBlockContent -ArgumentList $site,$newpath