Skip to content

Instantly share code, notes, and snippets.

@trodemaster
Created May 22, 2018 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trodemaster/e28d5ba72247269b6e978d0f43eea3fc to your computer and use it in GitHub Desktop.
Save trodemaster/e28d5ba72247269b6e978d0f43eea3fc to your computer and use it in GitHub Desktop.
if (!(test-path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers")) {
New-Item -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" -force -ErrorAction SilentlyContinue
}
new-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" -Name "C:\Windows\Temp\mseinstall.exe" -Value "~ WIN7RTM" -force -ErrorAction SilentlyContinue
#Write-host "Installing MSSE..."
if (Test-Path 'C:/Windows/Temp/mseinstall.exe'){
start-process -FilePath 'C:/Windows/Temp/mseinstall.exe' -ArgumentList '/s /q /o /runwgacheck /disableoslimit' -wait
} else {
Write-output "MSSE binary not found"
exit 1
}
if (get-service MsMpSvc) {
write-output "Microsoft Security Essentials Installed"
} else {
write-error "MSSE failed to install!!"
error 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment