mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-22 01:48:20 +02:00
Add pending reboot check to install-updates.ps1
This commit is contained in:
parent
746825f40f
commit
fc8919c7b0
@ -6,9 +6,10 @@
|
|||||||
NOTE: Use the script 'list-updates.ps1' to list the latest software updates before.
|
NOTE: Use the script 'list-updates.ps1' to list the latest software updates before.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./install-updates.ps1
|
PS> ./install-updates.ps1
|
||||||
⏳ (1/2) Checking drive and swap space...
|
⏳ (1/2) Checking requirements...
|
||||||
✅ Drive C: uses 56% of 1TB · 441GB free
|
✅ Drive C: has 441 GB free (56% of 1TB used)
|
||||||
✅ Swap space uses 2% of 1GB · 1GB free
|
✅ Swap space has 1GB free (2% of 1GB used)
|
||||||
|
✅ No pending system reboot
|
||||||
|
|
||||||
⏳ (2/2) Installing updates from winget and Microsoft Store...
|
⏳ (2/2) Installing updates from winget and Microsoft Store...
|
||||||
...
|
...
|
||||||
@ -22,9 +23,11 @@ try {
|
|||||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
"⏳ (1/5) Checking drive and swap space..."
|
"⏳ (1/5) Checking requirements..."
|
||||||
& "$PSScriptRoot/check-drive-space.ps1" /
|
& "$PSScriptRoot/check-drive-space.ps1" /
|
||||||
& "$PSScriptRoot/check-swap-space.ps1"
|
& "$PSScriptRoot/check-swap-space.ps1"
|
||||||
|
& "$PSScriptRoot/check-pending-reboot.ps1"
|
||||||
|
Start-Sleep -seconds 3
|
||||||
""
|
""
|
||||||
"⏳ (2/5) Querying latest package information..."
|
"⏳ (2/5) Querying latest package information..."
|
||||||
& sudo apt update
|
& sudo apt update
|
||||||
@ -42,9 +45,12 @@ try {
|
|||||||
& sudo softwareupdate -i -a
|
& sudo softwareupdate -i -a
|
||||||
Write-Progress -completed " "
|
Write-Progress -completed " "
|
||||||
} else {
|
} else {
|
||||||
"⏳ (1/2) Checking drive and swap space..."
|
# Windows:
|
||||||
|
"⏳ (1/2) Checking requirements..."
|
||||||
& "$PSScriptRoot/check-drive-space.ps1" C
|
& "$PSScriptRoot/check-drive-space.ps1" C
|
||||||
& "$PSScriptRoot/check-swap-space.ps1"
|
& "$PSScriptRoot/check-swap-space.ps1"
|
||||||
|
& "$PSScriptRoot/check-pending-reboot.ps1"
|
||||||
|
Start-Sleep -seconds 3
|
||||||
""
|
""
|
||||||
"⏳ (2/2) Installing updates from winget and Microsoft Store..."
|
"⏳ (2/2) Installing updates from winget and Microsoft Store..."
|
||||||
""
|
""
|
||||||
|
Loading…
Reference in New Issue
Block a user