From dd707225d022e34f7fcc63fde352f1934d224065 Mon Sep 17 00:00:00 2001 From: rgmcewan Date: Mon, 28 Oct 2024 23:10:10 +1000 Subject: [PATCH] c --- bts-anydesk.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) 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 ####################################