【发布时间】:2010-07-14 18:44:03
【问题描述】:
不确定 eff' 有什么问题!我在 Windows 7 上使用 Powershell 2.0。同样的脚本在 Windows XP 上工作,我只是错过了什么吗?
$server = "server1-vm1.prod.ds.russell.com"
$name = "Superduper_Reports"
$iis = [ADSI]"IIS://$server/W3SVC/AppPools/$name"
$iis.psbase.invoke("recycle")
错误(我觉得调用看起来没问题?):
Exception calling "Invoke" with "2" argument(s): "Unknown error (0x80005000)"
At line:3 char:19
+ $iis.psbase.invoke <<<< ("recycle")
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
当刚刚运行 $iis 变量时,我得到这个错误:
The following exception occurred while retrieving member "PSComputerName": "Unknown error (0x80005000)"
+ CategoryInfo : NotSpecified: (:) [format-default], ExtendedTypeSystemException
+ FullyQualifiedErrorId : CatchFromBaseGetMember,Microsoft.PowerShell.Commands.FormatDefaultCommand
哇!我宁愿使用 ADSI 而不是 WMI!有什么帮助吗? :)
【问题讨论】: