Added ability to force exception throwing

This commit is contained in:
Lord Hepipud 2019-09-17 17:12:06 +02:00
parent 17d8308e1f
commit 2c04a1ff64
2 changed files with 13 additions and 7 deletions

View file

@ -0,0 +1,3 @@
{
"1781451901841216379518196991491710121821213111390108.lastcheck": 132132048543175098
}

View file

@ -6,9 +6,11 @@ function Exit-IcingaThrowException()
[string]$CustomMessage,
[string]$ExceptionThrown,
[ValidateSet('Permission','Input','Unhandled')]
[string]$ExceptionType = 'Unhandled'
[string]$ExceptionType = 'Unhandled',
[switch]$Force
);
if ($Force -eq $FALSE) {
if ($null -eq $InputString -Or [string]::IsNullOrEmpty($InputString)) {
return;
}
@ -16,6 +18,7 @@ function Exit-IcingaThrowException()
if (-Not $InputString.Contains($StringPattern)) {
return;
}
}
$ExceptionMessageLib = $null;
$ExceptionTypeString = '';