Skip to content

Commit 566a64c

Browse files
authored
Merge pull request #240 from Icinga:fix/adds_missing_wmi_service_information
Fix: Adds missing attributes for services While filtering for certain services with `Get-IcingaServices`, there were some attributes missing from the collection. These are now added resulting in always correct output data.
2 parents 15fae3d + 7bd8dcc commit 566a64c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/31-Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1919

2020
### Bugfixes
2121

22+
* [#240](https://github.com/Icinga/icinga-powershell-framework/pull/240) While filtering for certain services with `Get-IcingaServices`, there were some attributes missing from the collection. These are now added resulting in always correct output data.
23+
2224
## 1.4.1 (2021-03-10)
2325

2426
[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/14?closed=1)

lib/core/tools/Get-IcingaServices.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ function Get-IcingaServices()
1111
if ($Service.Count -eq 0) {
1212
$ServiceWmiInfo = Get-IcingaWindowsInformation Win32_Service;
1313
} else {
14-
$ServiceWmiInfo = Get-IcingaWindowsInformation Win32_Service | Where-Object { $Service -Contains $_.Name } | Select-Object StartName, Name;
14+
$ServiceWmiInfo = Get-IcingaWindowsInformation Win32_Service | Where-Object { $Service -Contains $_.Name } | Select-Object StartName, Name, ExitCode, StartMode;
1515
}
1616

1717
if ($null -eq $ServiceInformation) {
1818
return $null;
1919
}
2020

21-
[hashtable]$ServiceData = @{};
21+
[hashtable]$ServiceData = @{ };
2222

2323
foreach ($service in $ServiceInformation) {
2424

0 commit comments

Comments
 (0)