mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-14 18:08:43 +01:00
Update check-pending-reboot.ps1 and install-updates.ps1
This commit is contained in:
parent
3dba184d19
commit
00d0fb333e
@ -5,7 +5,7 @@
|
||||
This PowerShell script queries pending operating system reboots and prints it.
|
||||
.EXAMPLE
|
||||
./check-pending-reboot.ps1
|
||||
✅ No pending system reboot
|
||||
✅ No pending reboot
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -60,11 +60,11 @@ try {
|
||||
$Reason += ", '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'"
|
||||
}
|
||||
if ($Reason -ne "") {
|
||||
Write-Host "⚠️ Pending reboot (registry contains $($Reason.substring(2)))"
|
||||
Write-Host "⚠️ Pending reboot (registry got $($Reason.substring(2)))"
|
||||
}
|
||||
}
|
||||
if ($Reason -eq "") {
|
||||
Write-Host "✅ No pending system reboot"
|
||||
Write-Host "✅ No pending reboot"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
@ -24,6 +24,7 @@ try {
|
||||
|
||||
if ($IsLinux) {
|
||||
"⏳ (1/5) Checking requirements..."
|
||||
& "$PSScriptRoot/check-smart-devices.ps1"
|
||||
& "$PSScriptRoot/check-drive-space.ps1" /
|
||||
& "$PSScriptRoot/check-swap-space.ps1"
|
||||
& "$PSScriptRoot/check-pending-reboot.ps1"
|
||||
@ -47,6 +48,7 @@ try {
|
||||
} else {
|
||||
# Windows:
|
||||
"⏳ (1/2) Checking requirements..."
|
||||
& "$PSScriptRoot/check-smart-devices.ps1"
|
||||
& "$PSScriptRoot/check-drive-space.ps1" C
|
||||
& "$PSScriptRoot/check-swap-space.ps1"
|
||||
& "$PSScriptRoot/check-pending-reboot.ps1"
|
||||
@ -57,7 +59,7 @@ try {
|
||||
& winget upgrade --all --include-unknown
|
||||
}
|
||||
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
|
||||
"✅ Installed updates in $elapsed sec"
|
||||
"✅ Installed updates in $elapsed sec."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user