From 0c114307b7c2f0461756e415c5021f1ee18db4cb Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 2 Mar 2020 15:04:52 +0100 Subject: [PATCH] enhance indent --- .../common/powershell/windows/liststorages.pm | 5 ++--- .../powershell/windows/pendingreboot.pm | 21 +++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/centreon/common/powershell/windows/liststorages.pm b/centreon/common/powershell/windows/liststorages.pm index a9fa92e56..ebfa6822b 100644 --- a/centreon/common/powershell/windows/liststorages.pm +++ b/centreon/common/powershell/windows/liststorages.pm @@ -34,7 +34,7 @@ $ProgressPreference = "SilentlyContinue" Try { $ErrorActionPreference = "Stop" - + $disks = Get-CimInstance Win32_LogicalDisk } Catch { @@ -68,8 +68,8 @@ sub list { $self->{output}->output_add(long_msg => "'" . $disk . "' [size = $size, free = $free, desc = $desc, type = $map_type{$type}]"); } } -1; +1; sub disco_show { my ($self, %options) = @_; @@ -104,4 +104,3 @@ __END__ Method to list Windows Disks. =cut - diff --git a/centreon/common/powershell/windows/pendingreboot.pm b/centreon/common/powershell/windows/pendingreboot.pm index 17f393c7d..f93bc752e 100644 --- a/centreon/common/powershell/windows/pendingreboot.pm +++ b/centreon/common/powershell/windows/pendingreboot.pm @@ -33,13 +33,13 @@ $ProgressPreference = "SilentlyContinue" Try { $ErrorActionPreference = "Stop" - + $ComputerName = "$env:COMPUTERNAME" $CompPendRen,$PendFileRename,$Pending,$SCCM = $false,$false,$false,$false - + ## Setting CBSRebootPend to null since not all versions of Windows has this value $CBSRebootPend = $null - + ## Querying WMI for build version $WMI_OS = Get-WmiObject -Class Win32_OperatingSystem -Property BuildNumber, CSName -ComputerName $ComputerName -ErrorAction Stop @@ -52,27 +52,27 @@ Try { $RegSubKeysCBS = $WMI_Reg.EnumKey($HKLM,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\") $CBSRebootPend = $RegSubKeysCBS.sNames -contains "RebootPending" } - + ## Query WUAU from the registry $RegWUAURebootReq = $WMI_Reg.EnumKey($HKLM,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\") $WUAURebootReq = $RegWUAURebootReq.sNames -contains "RebootRequired" - + ## Query PendingFileRenameOperations from the registry $RegSubKeySM = $WMI_Reg.GetMultiStringValue($HKLM,"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\","PendingFileRenameOperations") $RegValuePFRO = $RegSubKeySM.sValue - + ## Query ComputerName and ActiveComputerName from the registry $ActCompNm = $WMI_Reg.GetStringValue($HKLM,"SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\\","ComputerName") $CompNm = $WMI_Reg.GetStringValue($HKLM,"SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName\\","ComputerName") If ($ActCompNm -ne $CompNm) { $CompPendRen = $true } - + ## If PendingFileRenameOperations has a value set $RegValuePFRO variable to $true If ($RegValuePFRO) { $PendFileRename = $true } - + ## Determine SCCM 2012 Client Reboot Pending Status ## To avoid nested "if" statements and unneeded WMI calls to determine if the CCM_ClientUtilities class exist, setting EA = 0 $CCMClientSDK = $null @@ -95,7 +95,7 @@ Try { } Catch { $CCMClientSDK = $null } - + If ($CCMClientSDK) { If ($CCMClientSDK.ReturnValue -ne 0) { Write-Warning "Error: DetermineIfRebootPending returned error code $($CCMClientSDK.ReturnValue)" @@ -106,7 +106,7 @@ Try { } Else { $SCCM = $null } - + Write-Host ("[CBServicing={0}]" -f $CBSRebootPend ) -NoNewline Write-Host ("[WindowsUpdate={0}]" -f $WUAURebootReq ) -NoNewline Write-Host ("[CCMClientSDK={0}]" -f $SCCM ) -NoNewline @@ -134,4 +134,3 @@ __END__ Method to get pending reboot informations. =cut -