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
#Script to toggle Astro C40 controller between reading as Xbox/PS4 on windows. See this page for details: | |
#https://www.reddit.com/r/AstroGaming/comments/e5c5uk/psa_how_to_switch_c40_to_ps4_mode_on_windows_10/ | |
#Self elevate script | |
#http://www.expta.com/2017/03/how-to-self-elevate-powershell-script.html | |
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) | |
{ | |
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) | |
{ | |
$CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments |