Attachment 'Sblocca-win11.ps1'
Download 1 # Self-elevate the script if required
2 if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
3 $CommandLine = "-NoProfile -ExecutionPolicy Bypass -File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
4 # Set-ExecutionPolicy
5 Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
6 Exit
7 }
8
9
10 # Undo Set Windows to not upgrade past 22H2 (prevent Windows 11 auto-upgrade)
11 reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v TargetReleaseVersion
12 reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v TargetReleaseVersionInfo
13 reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v DisableOSUpgrade
14 reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /f /v ProductVersion
15
16
17 # Undo Other possible prevention
18 reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade /f /v AllowOSUpgrade
19 reg delete HKLM\SOFTWARE\Policies\Microsoft\WindowsStore /f /v DisableOSUpgrade
20
21 reg delete HKLM\SYSTEM\Setup\UpgradeNotification /f /v UpgradeAvailable
22
23 # Undo Prevent Windows PC Health Check install
24 reg delete HKLM\SOFTWARE\Microsoft\PCHC /f /v PreviousUninstall
25
26 Read-Host "Press any key to continue..."
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.