Created
May 22, 2018 22:16
-
-
Save trodemaster/e28d5ba72247269b6e978d0f43eea3fc to your computer and use it in GitHub Desktop.
This file contains 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
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