Automatically restart the computer
This commit is contained in:
parent
f39076dbff
commit
ba5fde3d3a
1 changed files with 1 additions and 0 deletions
|
@ -12,6 +12,7 @@ function Invoke-Upgrade([Context] $context)
|
||||||
Write-Debug "A Reboot is Required!";
|
Write-Debug "A Reboot is Required!";
|
||||||
Write-Debug "Windows will reboot now and the installation will be continued automatically.";
|
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;
|
$null = New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\RunOnce" -Name "PortValhalla" -Value "pwsh `"$($context.EntryPoint)`"" -PropertyType ExpandString;
|
||||||
|
Restart-Computer;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
elseif ((Get-WindowsUpdate).Count -gt 0)
|
elseif ((Get-WindowsUpdate).Count -gt 0)
|
||||||
|
|
Loading…
Reference in a new issue