There are numerous ways to find out if a script runs elevated. Here's a pretty simple approach:
PS> (whoami /all | Select-String S-1-16-12288) -ne $null
There are numerous ways to find out if a script runs elevated. Here's a pretty simple approach:
PS> (whoami /all | Select-String S-1-16-12288) -ne $null