Fixes CPU check failing on certain machines with error "Divided by 0"

This commit is contained in:
Lord Hepipud 2026-02-11 10:55:20 +01:00
parent 1d164f9ff7
commit f9c192db66
2 changed files with 9 additions and 1 deletions

View file

@ -7,6 +7,14 @@ documentation before upgrading to a new release.
Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed).
## 1.14.1 (2026-02-11)
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/43)
### Bugfixes
* [#859](https://github.com/Icinga/icinga-powershell-framework/issues/859) Fixes CPU plugin throwing an exception on certain Windows machines with `Divided by 0`
## 1.14.0 (2026-02-11)
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/38)

View file

@ -103,6 +103,6 @@ function New-IcingaEnvironmentVariable()
'FetchedServices' = $FALSE;
}
);
$Global:Icinga.Protected.Add('CPUSockets', (Get-IcingaWindowsInformation Win32_Processor).Count);
$Global:Icinga.Protected.Add('CPUSockets', ([array](Get-IcingaWindowsInformation Win32_Processor)).count);
}
}