mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
20 lines
469 B
PowerShell
20 lines
469 B
PowerShell
|
|
<#
|
||
|
|
.SYNOPSIS
|
||
|
|
This function returns the HRESULT unique value thrown by the last exception
|
||
|
|
.DESCRIPTION
|
||
|
|
This function returns the HRESULT unique value thrown by the last exception
|
||
|
|
.OUTPUTS
|
||
|
|
System.String
|
||
|
|
#>
|
||
|
|
function Get-IcingaLastExceptionId()
|
||
|
|
{
|
||
|
|
if ([string]::IsNullOrEmpty($Error)) {
|
||
|
|
return '';
|
||
|
|
}
|
||
|
|
|
||
|
|
[string]$ExceptionId = ([string]($Error.FullyQualifiedErrorId)).Split(',')[0].Split(' ')[1];
|
||
|
|
$Error.Clear();
|
||
|
|
|
||
|
|
return $ExceptionId;
|
||
|
|
}
|