mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Added ability to force exception throwing
This commit is contained in:
parent
17d8308e1f
commit
2c04a1ff64
2 changed files with 13 additions and 7 deletions
3
cache/provider/eventlog/1781451901841216379518196991491710121821213111390108.lastcheck.json
vendored
Normal file
3
cache/provider/eventlog/1781451901841216379518196991491710121821213111390108.lastcheck.json
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"1781451901841216379518196991491710121821213111390108.lastcheck": 132132048543175098
|
||||||
|
}
|
||||||
|
|
@ -6,9 +6,11 @@ function Exit-IcingaThrowException()
|
||||||
[string]$CustomMessage,
|
[string]$CustomMessage,
|
||||||
[string]$ExceptionThrown,
|
[string]$ExceptionThrown,
|
||||||
[ValidateSet('Permission','Input','Unhandled')]
|
[ValidateSet('Permission','Input','Unhandled')]
|
||||||
[string]$ExceptionType = 'Unhandled'
|
[string]$ExceptionType = 'Unhandled',
|
||||||
|
[switch]$Force
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($Force -eq $FALSE) {
|
||||||
if ($null -eq $InputString -Or [string]::IsNullOrEmpty($InputString)) {
|
if ($null -eq $InputString -Or [string]::IsNullOrEmpty($InputString)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -16,6 +18,7 @@ function Exit-IcingaThrowException()
|
||||||
if (-Not $InputString.Contains($StringPattern)) {
|
if (-Not $InputString.Contains($StringPattern)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$ExceptionMessageLib = $null;
|
$ExceptionMessageLib = $null;
|
||||||
$ExceptionTypeString = '';
|
$ExceptionTypeString = '';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue