Skip to content

Commit

Permalink
Use CIM instead of WMI for Win32_Service calls
Browse files Browse the repository at this point in the history
Implements #34
  • Loading branch information
LordHepipud committed Aug 20, 2020
1 parent 8dd3be2 commit 3752657
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions provider/services/Icinga_ProviderServices.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function Get-IcingaServices()
$ServiceWmiInfo = $null;

if ($Service.Count -eq 0) {
$ServiceWmiInfo = Get-IcingaWindowsInformation Win32_Service -ForceWMI;
$ServiceWmiInfo = Get-IcingaWindowsInformation Win32_Service;
} else {
$ServiceWmiInfo = Get-IcingaWindowsInformation Win32_Service -ForceWMI | Where-Object { $Service -Contains $_.Name } | Select-Object StartName, Name;
$ServiceWmiInfo = Get-IcingaWindowsInformation Win32_Service | Where-Object { $Service -Contains $_.Name } | Select-Object StartName, Name;
}

if ($null -eq $ServiceInformation) {
Expand Down

0 comments on commit 3752657

Please sign in to comment.