Last active
August 12, 2025 19:32
-
-
Save simstems/ddf883c764c3ae26106703c56746f860 to your computer and use it in GitHub Desktop.
Run updates on a list of remote systems.
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
| $namesList = @( | |
| "[PC-NAME]", | |
| "[PC-NAME]", | |
| "[PC-NAME]", | |
| ) | |
| foreach ($name in $namesList) { | |
| Enter-PSSession -ComputerName $name | |
| gpupdate /force | |
| # Install-Module -Name PSWindowsUpdate -Force | |
| # Start-Sleep -Seconds 5 | |
| Import-Module PSWindowsUpdate | |
| Get-WindowsUpdate | |
| Install-WindowsUpdate -AcceptAll -AutoReboot | |
| Start-Sleep -Seconds 60 | |
| # Restart-Computer -Force | |
| exit | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment