From 22d0ed33b5f979d256476d8370493924d45735a9 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Sun, 6 Oct 2019 18:06:41 +0200 Subject: [PATCH] Improved code styling --- lib/core/icingaagent/getters/Get-IcingaServiceUser.psm1 | 1 - lib/core/icingaagent/tests/Test-IcingaAcl.psm1 | 1 - lib/provider/services/Icinga_ProviderServices.psm1 | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/core/icingaagent/getters/Get-IcingaServiceUser.psm1 b/lib/core/icingaagent/getters/Get-IcingaServiceUser.psm1 index cb3e2b8..dd867c8 100644 --- a/lib/core/icingaagent/getters/Get-IcingaServiceUser.psm1 +++ b/lib/core/icingaagent/getters/Get-IcingaServiceUser.psm1 @@ -1,7 +1,6 @@ function Get-IcingaServiceUser() { $Services = Get-IcingaServices -Service 'icinga2'; - if ($null -eq $Services) { throw 'Icinga Service not installed'; } diff --git a/lib/core/icingaagent/tests/Test-IcingaAcl.psm1 b/lib/core/icingaagent/tests/Test-IcingaAcl.psm1 index 2914a04..4d1d0c3 100644 --- a/lib/core/icingaagent/tests/Test-IcingaAcl.psm1 +++ b/lib/core/icingaagent/tests/Test-IcingaAcl.psm1 @@ -13,7 +13,6 @@ function Test-IcingaAcl() $ServiceUser = Get-IcingaServiceUser; $UserFound = $FALSE; $HasAccess = $FALSE; - foreach ($user in $FolderACL.Access) { # Not only check here for the exact name but also for included strings like NT AU or NT-AU or even further later on # As the Get-Acl Cmdlet will translate usernames into the own language, resultng in 'NT AUTHORITY\NetworkService' being translated diff --git a/lib/provider/services/Icinga_ProviderServices.psm1 b/lib/provider/services/Icinga_ProviderServices.psm1 index 74d66a4..a6e5a0f 100644 --- a/lib/provider/services/Icinga_ProviderServices.psm1 +++ b/lib/provider/services/Icinga_ProviderServices.psm1 @@ -2,7 +2,7 @@ function Get-IcingaServices() { param ( [array]$Service - ) + ); $ServiceInformation = Get-Service -Name $Service -ErrorAction SilentlyContinue; $ServiceWmiInfo = $null;