Last active
March 9, 2021 21:32
-
-
Save PapeCoding/18002afa821d7c8b2b213f0365a19c30 to your computer and use it in GitHub Desktop.
Toggle HyperV for the FACEIT Anti-Cheat
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 (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) | |
{ Write-Host "No Adminrights. restart as Administrator" | |
$arguments = "& ‚" + $myinvocation.mycommand.definition + "‚" | |
Start-Process powershell -Verb runAs -ArgumentList $arguments | |
Break | |
} | |
$oldValue = (bcdedit | Select-String -Pattern "hypervisorlaunchtype").toString().split() | select -Last 1 | |
If ( $oldValue -eq "Off") | |
{ | |
reg delete "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v "Enabled" /f | |
bcdedit /set hypervisorlaunchtype "Auto" | |
echo "Activated HyperV." | |
} | |
Else | |
{ | |
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v "Enabled" /t REG_DWORD /d 0 /f | |
bcdedit /set hypervisorlaunchtype "Off" | |
echo "Deactivated HyperV." | |
} | |
read-host "Press ENTER to continue..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment