Skip to content

Instantly share code, notes, and snippets.

@trodemaster
Created September 3, 2015 02:59
Show Gist options
  • Save trodemaster/5bbeb2cc0badf432eafd to your computer and use it in GitHub Desktop.
Save trodemaster/5bbeb2cc0badf432eafd to your computer and use it in GitHub Desktop.
# install powershellget
Get-PackageProvider -Name NuGet -ForceBootstrap
# allow repo install
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# install PolicyFileEditor
Install-Module -Name PolicyFileEditor -Confirm:$false
# disable web results search bar
Set-PolicyFileEntry -Path $env:systemroot\system32\GroupPolicy\Machine\registry.pol -Key "Software\Policies\Microsoft\Windows\Windows Search" -ValueName ConnectedSearchUseWeb -Data 0 -Type DWord
# disable windows defender
Set-PolicyFileEntry -Path $env:systemroot\system32\GroupPolicy\Machine\registry.pol -Key "Software\Policies\Microsoft\Windows Defender" -ValueName DisableAntiSpyware -Data 1 -Type DWord
# disable Cortana
Set-PolicyFileEntry -Path $env:systemroot\system32\GroupPolicy\Machine\registry.pol -Key "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -ValueName AllowCortana -Data 0 -Type DWord
# show results
write-host Listing configured local windows policies
Get-PolicyFileEntry -Path $env:systemroot\system32\GroupPolicy\Machine\registry.pol -All
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment