1
设置physicalPath
远程执行以下消息示数:的Set-ItemProperty 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
Ahhhhhh,谢谢。 –