From ba5fde3d3aac0d50b8a4f4570c12a17e3f5be940 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 22 Jun 2023 17:19:00 +0200 Subject: [PATCH] Automatically restart the computer --- scripts/Windows/OS/Upgrade.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Windows/OS/Upgrade.ps1 b/scripts/Windows/OS/Upgrade.ps1 index cc19a2a9..657c4337 100644 --- a/scripts/Windows/OS/Upgrade.ps1 +++ b/scripts/Windows/OS/Upgrade.ps1 @@ -12,6 +12,7 @@ function Invoke-Upgrade([Context] $context) Write-Debug "A Reboot is Required!"; Write-Debug "Windows will reboot now and the installation will be continued automatically."; $null = New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\RunOnce" -Name "PortValhalla" -Value "pwsh `"$($context.EntryPoint)`"" -PropertyType ExpandString; + Restart-Computer; exit; } elseif ((Get-WindowsUpdate).Count -gt 0)