This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Test-AdministratorContext { | |
| [CmdletBinding()]param() | |
| $CurrentWindowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent() | |
| $CurrentWindowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($CurrentWindowsIdentity) | |
| $IsAdministratorContext = $CurrentWindowsPrincipal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator) | |
| Write-Verbose "Current Context Is Administrator = $IsAdministratorContext" | |
| return $IsAdministratorContext | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| format binary as 'exe' | |
| IMAGE_DOS_SIGNATURE equ 5A4Dh | |
| IMAGE_NT_SIGNATURE equ 00004550h | |
| PROCESSOR_AMD_X8664 equ 8664h | |
| IMAGE_SCN_CNT_CODE equ 00000020h | |
| IMAGE_SCN_MEM_READ equ 40000000h | |
| IMAGE_SCN_MEM_WRITE equ 80000000h | |
| IMAGE_SCN_CNT_INITIALIZED_DATA equ 00000040h | |
| IMAGE_SUBSYSTEM_WINDOWS_GUI equ 2 | |
| IMAGE_NT_OPTIONAL_HDR64_MAGIC equ 20Bh |