Skip to content

Commit fd3a332

Browse files
authored
Create Administrative privileges.ps1
1 parent 05492b3 commit fd3a332

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function AmIAdmin {
2+
$MyId=[System.Security.Principal.WindowsIdentity]::GetCurrent()
3+
$WindowsPrincipal=New-Object System.Security.Principal.WindowsPrincipal( $MyId )
4+
return $WindowsPrincipal.IsInRole( [System.Security.Principal.WindowsBuiltInRole]::Administrator )
5+
}

0 commit comments

Comments
 (0)