1
0

uac-module.psm1 413 B

123456789101112
  1. function Get-IsAdministrator
  2. {
  3. $Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
  4. $Principal = New-Object System.Security.Principal.WindowsPrincipal($Identity)
  5. $Principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
  6. }
  7. function Get-IsUacEnabled
  8. {
  9. (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System).EnableLua -ne 0
  10. }