Skip to content

Instantly share code, notes, and snippets.

@Nora-Ballard
Created October 17, 2015 22:11
Show Gist options
  • Save Nora-Ballard/e1d00df065859cf707b2 to your computer and use it in GitHub Desktop.
Save Nora-Ballard/e1d00df065859cf707b2 to your computer and use it in GitHub Desktop.
Enable Windows 10 Upgrade, to get past the 'Wait for notification' screen
function Enable-WindowsOSUpgrade {
[CmdletBinding(
SupportsShouldProcess = $true
)]
param(
)
$Properties = @{
Path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade'
Name = 'AllowOSUpgrade'
}
if ($PSCmdlet.ShouldProcess('Enable','AllowOSUpgrade')) {
Set-ItemProperty @Properties -Value 1
}
$Value = (Get-ItemProperty @Properties).$($Properties.Name)
if ($Value -ne 1) {
Write-Error "Failed to perform action 'Enable' on 'AllowOSUpgrade'"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment