Windows
Windows Update via Powershell
De få linjer PowerShell, der henter og installerer Windows-opdateringer på en maskine — med PSWindowsUpdate-modulet og uden en genstart, du ikke har bedt om.
Set-ExecutionPolicy Unrestricted
# 2. Install the PSWindowsUpdate module if not already installed
Install-Module -Name PSWindowsUpdate -Force -AllowClobber
# 3. Import the module
Import-Module PSWindowsUpdate
# 4. Check for and install the 25H2 update
# -AcceptAll automatically accepts license agreements
# -IgnoreReboot prevents an immediate reboot, allow it if you are ready
Get-WindowsUpdate -AcceptAll -Install -IgnoreReboot
# 5. Set ExecutionPolicy to default
Set-ExecutionPolicy Default
