Skip to content

Commit

Permalink
Update itt.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
emadadel4 committed Dec 12, 2024
1 parent 57855f0 commit f11e42d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions itt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ $itt = [Hashtable]::Synchronized(@{

})

$currentPid = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$principal = [System.Security.Principal.WindowsPrincipal]$currentPid
$administrator = [System.Security.Principal.WindowsBuiltInRole]::Administrator

if (-not $principal.IsInRole($administrator))
# Ask user
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
$newProcess = Start-Process -FilePath "PowerShell" -ArgumentList "-ExecutionPolicy Bypass -NoProfile -Command `"$($MyInvocation.MyCommand.Definition)`"" -Verb RunAs
exit
Expand Down

0 comments on commit f11e42d

Please sign in to comment.