diff --git a/bts-anydesk.ps1 b/bts-anydesk.ps1 index 4ffd0e7..21a2e4a 100644 --- a/bts-anydesk.ps1 +++ b/bts-anydesk.ps1 @@ -1,3 +1,12 @@ + #code to make sure the script is running as admin + If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) + { + # Relaunch as an elevated process: + Start-Process powershell.exe "-ExecutionPolicy","bypass","-File",('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs + exit + } + + #################################### # Base System Changes and UI Tweaks ####################################