mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Fixed arguments to properly work on all Windows environments
This commit is contained in:
parent
b34f539d01
commit
580b99b444
2 changed files with 4 additions and 4 deletions
|
|
@ -4,17 +4,17 @@ Import-IcingaLib icinga\exception;
|
|||
function Exit-IcingaMissingPermission()
|
||||
{
|
||||
param(
|
||||
[string]$Input,
|
||||
[string]$InputString,
|
||||
[string]$StringPattern,
|
||||
[string]$CustomMessage,
|
||||
[string]$ExeptionType
|
||||
);
|
||||
|
||||
if ($null -eq $Input -Or [string]::IsNullOrEmpty($Input)) {
|
||||
if ($null -eq $InputString -Or [string]::IsNullOrEmpty($InputString)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (-Not $Input.Contains($StringPattern)) {
|
||||
if (-Not $InputString.Contains($StringPattern)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ function Invoke-IcingaCheckCPU()
|
|||
$CpuCounter = New-IcingaPerformanceCounter -Counter ([string]::Format('\Processor({0})\% processor time', $Core));
|
||||
$CpuPackage = New-IcingaCheckPackage -Name 'CPU Load' -OperatorAnd -Verbos $Verbose;
|
||||
|
||||
Exit-IcingaMissingPermission -Input $CpuCounter.ErrorMessage -StringPattern '"Global"' -ExeptionType $IcingaExceptions.Throw.PerformanceCounter;
|
||||
Exit-IcingaMissingPermission -InputString $CpuCounter.ErrorMessage -StringPattern '"Global"' -ExeptionType $IcingaExceptions.Throw.PerformanceCounter;
|
||||
|
||||
if ($CpuCounter.Counters.Count -ne 0) {
|
||||
foreach ($counter in $CpuCounter.Counters) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue