【发布时间】:2020-03-16 12:36:27
【问题描述】:
通过 VMware API 运行 powershell 时,我得到的退出代码为 0x80131029。
有没有办法通过windows log或者其他方法找出这个退出码的原因?
正在使用以下 cmdlet:
获取-WMIObject
获取项目属性
获取-CimInstance
【问题讨论】:
标签: powershell remote-access vsphere vmware-tools
通过 VMware API 运行 powershell 时,我得到的退出代码为 0x80131029。
有没有办法通过windows log或者其他方法找出这个退出码的原因?
正在使用以下 cmdlet:
获取-WMIObject
获取项目属性
获取-CimInstance
【问题讨论】:
标签: powershell remote-access vsphere vmware-tools
通过以下函数,您可以获得(大部分)这些 HRESULT 值的描述:
function Resolve-HResult {
param(
[Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)]
[int32[]]$HResult
)
Process {
foreach ($hr in $HResult) {
$comEx = [System.Runtime.InteropServices.Marshal]::GetExceptionForHR($hr)
if ($comEx) {
$comEx.Message
}
else {
Write-Error "$hr doesn't correspond to a known HResult"
}
}
}
}
在你的情况下:
Resolve-HResult 0x80131029
返回
Process exited due to Timeout escalation.
希望有帮助
【讨论】: