使用以下功能,您可以获得(大多数)这些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.
希望有所帮助