# 5. Set ExecutionPolicy to Unrestricted
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