Update check-cpu.ps1, check-os.ps1, and check-pending-reboot.ps1

This commit is contained in:
Markus Fleschutz 2022-12-01 21:39:03 +01:00
parent 22c3068d1d
commit dd4f14f6c6
3 changed files with 6 additions and 6 deletions

View File

@ -42,7 +42,7 @@ try {
} }
if ($IsLinux) { if ($IsLinux) {
"✅ CPU is $Temp." "✅ CPU is $Temp"
} else { } else {
$Details = Get-WmiObject -Class Win32_Processor $Details = Get-WmiObject -Class Win32_Processor
$DeviceName = $Details.Name.trim() $DeviceName = $Details.Name.trim()

View File

@ -13,7 +13,7 @@
try { try {
if ($IsLinux) { if ($IsLinux) {
"$(uname -sr)." "$(uname -sr)"
} else { } else {
$OS = Get-WmiObject -class Win32_OperatingSystem $OS = Get-WmiObject -class Win32_OperatingSystem
$Name = $OS.Caption $Name = $OS.Caption
@ -31,4 +31,4 @@ try {
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1 exit 1
} }

View File

@ -56,8 +56,8 @@ if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon"
$Reason += ", found registry entry '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'" $Reason += ", found registry entry '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'"
} }
if ($Reason -ne "") { if ($Reason -ne "") {
"⚠️ Pending reboot ($($Reason.substring(2)))." "⚠️ Pending reboot ($($Reason.substring(2)))"
} else { } else {
"✅ No pending reboot." "✅ No pending reboot"
} }
exit 0 # success exit 0 # success