Iis 通过Invoke命令创建网站时引发异常
我在呼叫指挥部Iis 通过Invoke命令创建网站时引发异常,iis,powershell,Iis,Powershell,我在呼叫指挥部 Invoke-Command -computername remotepc { Import-Module WebAdministration; New-Website -Name www.somesite.com -ApplicationPool www.somesite.com -hostHeader www.somesite.com -physicalPath c:\inetpub\wwwroot } 已在远程计算机上的IIS中成功创建网站。但是,当powershe
Invoke-Command -computername remotepc {
Import-Module WebAdministration;
New-Website -Name www.somesite.com -ApplicationPool www.somesite.com -hostHeader www.somesite.com -physicalPath c:\inetpub\wwwroot }
已在远程计算机上的IIS中成功创建网站。但是,当powershell返回时,将显示一条异常消息:
Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))
+ CategoryInfo : NotSpecified: (:) [New-Website], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.IIs.PowerShell.Provider.NewWebsite
Command
有人知道我为什么会收到此消息以及我如何解决此问题吗?您能试试:
$var = New-Website ...
不确定,但新建网站
返回PowerShell远程会话尝试序列化失败的对象