Last active
November 27, 2023 09:22
-
-
Save lnksz/d565c1de449aa94827d6dd37724a5431 to your computer and use it in GitHub Desktop.
Windows 10/11 unattended updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo %date% %time% Updating >> C:\SOMEPATH\unattended-updates\log.txt | |
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\SOMEPATH\unattended-updates\upmyms.ps1" 1>>C:\SOMEPATH\unattended-updates\log.txt 2>&1 | |
echo %date% %time% DONE >> C:\SOMEPATH\unattended-updates\log.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One-Time | |
# Install PSWindowsUpdate from Gallery from and Admin Shell | |
# This may ask to install NuGet via PowerShellGet | |
Install-Module -Name PSWindowsUpdate -Force | |
# Task | |
Write-Output "=== Start CHOCO Update" | |
choco upgrade all -y | |
Write-Output "=== Start Windows Update" | |
Get-WUList -MicrosoftUpdate | |
Get-WindowsUpdate -AcceptAll -Install -AutoReboot | |
Write-Output "=== DONE ===" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment