Skip to content

Instantly share code, notes, and snippets.

@ChieftainY2k
Created July 21, 2026 14:51
Show Gist options
  • Select an option

  • Save ChieftainY2k/22e151bb3a6c6a080b069407357d57ec to your computer and use it in GitHub Desktop.

Select an option

Save ChieftainY2k/22e151bb3a6c6a080b069407357d57ec to your computer and use it in GitHub Desktop.
Prevent Win11 from downloading extra software on USB connect
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Force | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" `
-Name "PreventDeviceMetadataFromNetwork" `
-Type DWord `
-Value 1
gpupdate /target:computer /force
Write-Host "Done. Restart Windows to ensure the policy is applied." -ForegroundColor Green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment