From bfff046e4dbe1fb337eaaf2c2e30d6a11dee016c Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 18 Jul 2023 21:57:08 +0200 Subject: [PATCH] Ignore exceptions during updates --- scripts/Windows/OS/Upgrade.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/OS/Upgrade.ps1 b/scripts/Windows/OS/Upgrade.ps1 index dce5ee55..9c6a4aa8 100644 --- a/scripts/Windows/OS/Upgrade.ps1 +++ b/scripts/Windows/OS/Upgrade.ps1 @@ -9,7 +9,11 @@ function Update-WindowsInstallation([Context] $context) $null = Import-Module PSWindowsUpdate; Write-Host "Performing Windows Update"; - $null = Install-WindowsUpdate -AcceptAll -IgnoreReboot -ErrorAction "SilentlyContinue"; + + try { + $null = Install-WindowsUpdate -AcceptAll -IgnoreReboot -ErrorAction "SilentlyContinue"; + } + catch { } if ((Get-WURebootStatus -Silent)) {