Created
May 14, 2025 21:34
-
-
Save MuntashirAkon/d436af26cf7a52f3c2d852862cfb3b1b to your computer and use it in GitHub Desktop.
Restrict Window 11 version to the current Windows version to prevent any major updates (which often break stuffs). Security and quality updates will still be provided.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get current Windows DisplayVersion (e.g., 24H2) | |
$CurrentVersion = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").DisplayVersion | |
# Define the target registry path | |
$RegPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" | |
# Create the registry key if it does not exist | |
if (-not (Test-Path $RegPath)) { | |
New-Item -Path $RegPath -Force | Out-Null | |
} | |
# Set the required registry values | |
Set-ItemProperty -Path $RegPath -Name "ProductVersion" -Value "Windows 11" -Type String | |
Set-ItemProperty -Path $RegPath -Name "TargetReleaseVersion" -Value 1 -Type DWord | |
Set-ItemProperty -Path $RegPath -Name "TargetReleaseVersionInfo" -Value $CurrentVersion -Type String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment