Powershell导入模块webadministration
每次我执行这个命令 invoke-command -computername REMOTEPC -scriptblock { import-module WebAdministration; new-item "$env:systemdrive\inetpub\testsite" -type directory; New-WebSite -Name TestSite -Port 81 -PhysicalPath "$env:systemdrive\inetpub\testsite" } 我得到以下错误 Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING)) + CategoryInfo : NotSpecified: (:) [Get-ChildItem], COMException + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.PowerShell.Commands.GetChildItemCommand 据我所知,该网站已成功创build。 枚举testsite时,下面的命令给出同样的错误 Invoke-Command -computername REMOTEPC { import-module webadministration; dir -path IIS:\Sites\ } Name ID State […]