Debug School

Cover image for Win Updates via PS1
Suyash Sambhare
Suyash Sambhare

Posted on

Win Updates via PS1

PowerShell file

cd C:\
sfc /scannow
chkdsk C: /scan /perf
winget upgrade --all
install-Module PSWindowsUpdate -Force
import-Module PSWindowsUpdate
get-WindowsUpdate -Install -AcceptAll
tree
shutdown /r
exit
Enter fullscreen mode Exit fullscreen mode

Art6

Requires reboot

Top comments (2)

Collapse
 
suyash profile image
Suyash Sambhare • Edited
cd C:\
sfc /scannow
& "C:\Program Files\Dell\CommandUpdate\dcu-cli.exe" /applyUpdates -reboot=disable
chkdsk C: /scan /perf
winget upgrade --source msstore --all
winget upgrade --all --include-unknown
install-Module PSWindowsUpdate -Force
import-Module PSWindowsUpdate
get-WindowsUpdate -Install -AcceptAll
tree
exit
Enter fullscreen mode Exit fullscreen mode
Collapse
 
suyash profile image
Suyash Sambhare
echo "Run maintenance script"
cd C:\
echo "Check system files"
sfc /scannow
echo "Update Dell firmware"
& "C:\Program Files\Dell\CommandUpdate\dcu-cli.exe" /applyUpdates -reboot=disable
echo "Check disk"
chkdsk C: /scan /perf
echo "Upgrade Windows store apps"
winget upgrade --source msstore --all
echo "Upgrade Winget applications"
winget upgrade --all --include-unknown
echo "Update PowerShell modules"
Update-Help -Force
Update-Module -Force
echo "Perform Windows update"
Install-Module PSWindowsUpdate -Force
import-Module PSWindowsUpdate
get-WindowsUpdate -Install -AcceptAll -IgnoreReboot
# echo "Tree walk"
# tree
echo "Complete!"
exit
Enter fullscreen mode Exit fullscreen mode