enhance indent
This commit is contained in:
parent
9a4554c8e8
commit
0c114307b7
|
@ -34,7 +34,7 @@ $ProgressPreference = "SilentlyContinue"
|
||||||
|
|
||||||
Try {
|
Try {
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
$disks = Get-CimInstance Win32_LogicalDisk
|
$disks = Get-CimInstance Win32_LogicalDisk
|
||||||
|
|
||||||
} Catch {
|
} Catch {
|
||||||
|
@ -68,8 +68,8 @@ sub list {
|
||||||
$self->{output}->output_add(long_msg => "'" . $disk . "' [size = $size, free = $free, desc = $desc, type = $map_type{$type}]");
|
$self->{output}->output_add(long_msg => "'" . $disk . "' [size = $size, free = $free, desc = $desc, type = $map_type{$type}]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
1;
|
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
sub disco_show {
|
sub disco_show {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
@ -104,4 +104,3 @@ __END__
|
||||||
Method to list Windows Disks.
|
Method to list Windows Disks.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
|
@ -33,13 +33,13 @@ $ProgressPreference = "SilentlyContinue"
|
||||||
|
|
||||||
Try {
|
Try {
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
$ComputerName = "$env:COMPUTERNAME"
|
$ComputerName = "$env:COMPUTERNAME"
|
||||||
$CompPendRen,$PendFileRename,$Pending,$SCCM = $false,$false,$false,$false
|
$CompPendRen,$PendFileRename,$Pending,$SCCM = $false,$false,$false,$false
|
||||||
|
|
||||||
## Setting CBSRebootPend to null since not all versions of Windows has this value
|
## Setting CBSRebootPend to null since not all versions of Windows has this value
|
||||||
$CBSRebootPend = $null
|
$CBSRebootPend = $null
|
||||||
|
|
||||||
## Querying WMI for build version
|
## Querying WMI for build version
|
||||||
$WMI_OS = Get-WmiObject -Class Win32_OperatingSystem -Property BuildNumber, CSName -ComputerName $ComputerName -ErrorAction Stop
|
$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\\")
|
$RegSubKeysCBS = $WMI_Reg.EnumKey($HKLM,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\")
|
||||||
$CBSRebootPend = $RegSubKeysCBS.sNames -contains "RebootPending"
|
$CBSRebootPend = $RegSubKeysCBS.sNames -contains "RebootPending"
|
||||||
}
|
}
|
||||||
|
|
||||||
## Query WUAU from the registry
|
## Query WUAU from the registry
|
||||||
$RegWUAURebootReq = $WMI_Reg.EnumKey($HKLM,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\")
|
$RegWUAURebootReq = $WMI_Reg.EnumKey($HKLM,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\")
|
||||||
$WUAURebootReq = $RegWUAURebootReq.sNames -contains "RebootRequired"
|
$WUAURebootReq = $RegWUAURebootReq.sNames -contains "RebootRequired"
|
||||||
|
|
||||||
## Query PendingFileRenameOperations from the registry
|
## Query PendingFileRenameOperations from the registry
|
||||||
$RegSubKeySM = $WMI_Reg.GetMultiStringValue($HKLM,"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\","PendingFileRenameOperations")
|
$RegSubKeySM = $WMI_Reg.GetMultiStringValue($HKLM,"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\","PendingFileRenameOperations")
|
||||||
$RegValuePFRO = $RegSubKeySM.sValue
|
$RegValuePFRO = $RegSubKeySM.sValue
|
||||||
|
|
||||||
## Query ComputerName and ActiveComputerName from the registry
|
## Query ComputerName and ActiveComputerName from the registry
|
||||||
$ActCompNm = $WMI_Reg.GetStringValue($HKLM,"SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\\","ComputerName")
|
$ActCompNm = $WMI_Reg.GetStringValue($HKLM,"SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\\","ComputerName")
|
||||||
$CompNm = $WMI_Reg.GetStringValue($HKLM,"SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName\\","ComputerName")
|
$CompNm = $WMI_Reg.GetStringValue($HKLM,"SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName\\","ComputerName")
|
||||||
If ($ActCompNm -ne $CompNm) {
|
If ($ActCompNm -ne $CompNm) {
|
||||||
$CompPendRen = $true
|
$CompPendRen = $true
|
||||||
}
|
}
|
||||||
|
|
||||||
## If PendingFileRenameOperations has a value set $RegValuePFRO variable to $true
|
## If PendingFileRenameOperations has a value set $RegValuePFRO variable to $true
|
||||||
If ($RegValuePFRO) {
|
If ($RegValuePFRO) {
|
||||||
$PendFileRename = $true
|
$PendFileRename = $true
|
||||||
}
|
}
|
||||||
|
|
||||||
## Determine SCCM 2012 Client Reboot Pending Status
|
## 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
|
## To avoid nested "if" statements and unneeded WMI calls to determine if the CCM_ClientUtilities class exist, setting EA = 0
|
||||||
$CCMClientSDK = $null
|
$CCMClientSDK = $null
|
||||||
|
@ -95,7 +95,7 @@ Try {
|
||||||
} Catch {
|
} Catch {
|
||||||
$CCMClientSDK = $null
|
$CCMClientSDK = $null
|
||||||
}
|
}
|
||||||
|
|
||||||
If ($CCMClientSDK) {
|
If ($CCMClientSDK) {
|
||||||
If ($CCMClientSDK.ReturnValue -ne 0) {
|
If ($CCMClientSDK.ReturnValue -ne 0) {
|
||||||
Write-Warning "Error: DetermineIfRebootPending returned error code $($CCMClientSDK.ReturnValue)"
|
Write-Warning "Error: DetermineIfRebootPending returned error code $($CCMClientSDK.ReturnValue)"
|
||||||
|
@ -106,7 +106,7 @@ Try {
|
||||||
} Else {
|
} Else {
|
||||||
$SCCM = $null
|
$SCCM = $null
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host ("[CBServicing={0}]" -f $CBSRebootPend ) -NoNewline
|
Write-Host ("[CBServicing={0}]" -f $CBSRebootPend ) -NoNewline
|
||||||
Write-Host ("[WindowsUpdate={0}]" -f $WUAURebootReq ) -NoNewline
|
Write-Host ("[WindowsUpdate={0}]" -f $WUAURebootReq ) -NoNewline
|
||||||
Write-Host ("[CCMClientSDK={0}]" -f $SCCM ) -NoNewline
|
Write-Host ("[CCMClientSDK={0}]" -f $SCCM ) -NoNewline
|
||||||
|
@ -134,4 +134,3 @@ __END__
|
||||||
Method to get pending reboot informations.
|
Method to get pending reboot informations.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue