mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
12 lines
413 B
PowerShell
12 lines
413 B
PowerShell
|
function Get-IsAdministrator
|
|||
|
{
|
|||
|
$Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
|
|||
|
$Principal = New-Object System.Security.Principal.WindowsPrincipal($Identity)
|
|||
|
$Principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
function Get-IsUacEnabled
|
|||
|
{
|
|||
|
(Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System).EnableLua -ne 0
|
|||
|
}
|