移至 Windows 8,我正在尝试在 powershell 中运行以下命令
# Load the Web Management and Administration Assembly
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Management")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
$ServerManager = New-Object Microsoft.Web.Administration.ServerManager
$defaultSite = $ServerManager.Sites["Default Web Site"];
Sites 数组为空
跑步
appcmd.exe list sites
给
SITE "Default Web Site" (id:1,bindings:http/*:80:,state:Started)
这适用于带有 Windows 7 的 IIS 7
谢谢,