mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-19 11:26:43 +02:00
Updated check-pending-reboot.ps1
This commit is contained in:
parent
72b8c58768
commit
5390e1fa70
@ -5,7 +5,7 @@
|
|||||||
This PowerShell script queries pending operating system reboots and prints it.
|
This PowerShell script queries pending operating system reboots and prints it.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
./check-pending-reboot.ps1
|
./check-pending-reboot.ps1
|
||||||
✅ No pending reboot
|
✅ No pending reboot.
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -22,7 +22,7 @@ function Test-RegistryValue { param([parameter(Mandatory=$true)][ValidateNotNull
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$reply = "✅ No pending reboot"
|
[string]$reply = "✅ No pending reboot."
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
if (Test-Path "/var/run/reboot-required") {
|
if (Test-Path "/var/run/reboot-required") {
|
||||||
$reply = "⚠️ Pending reboot (found: /var/run/reboot-required)"
|
$reply = "⚠️ Pending reboot (found: /var/run/reboot-required)"
|
||||||
@ -60,7 +60,7 @@ try {
|
|||||||
$reason += ", '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'"
|
$reason += ", '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'"
|
||||||
}
|
}
|
||||||
if ($reason -ne "") {
|
if ($reason -ne "") {
|
||||||
$reply = "⚠️ Pending reboot (registry got $($reason.substring(2)))"
|
$reply = "⚠️ Pending reboot (found: $($reason.substring(2)) in registry)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Write-Host $reply
|
Write-Host $reply
|
||||||
|
Loading…
x
Reference in New Issue
Block a user