first commit

This commit is contained in:
2025-11-21 17:17:42 +01:00
commit 4cad18c2a5
285 changed files with 122106 additions and 0 deletions
@@ -0,0 +1,40 @@
## Description
These functions are used to determine if you have Admin level privledges
## The Function
### [If-Admin-Window]
This function will let you know if you are currently in an Admin Privledge Level window
```PowerShell
function If-Admin-Window {
$user = [Security.Principal.WindowsIdentity]::GetCurrent();
$isAdmin = (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
if($isAdmin){
Write-host 'Is Admin Window' -BackgroundColor DarkRed -ForegroundColor White
}
else{
Write-host 'Not Admin Window' -BackgroundColor DarkBlue -ForegroundColor White
}
}
```
### [If-Admin]
This function will run the current user against LocalGroupMember to return True or False if Profile has Admin Privledges
```PowerShell
function If-Admin {
$user = "$env:COMPUTERNAME\$env:USERNAME"
$isAdmin = (Get-LocalGroupMember 'Administrators').Name -contains $user
if($isAdmin){
Write-host 'Is Admin' -BackgroundColor DarkRed -ForegroundColor White
}
else{
Write-host 'Not Admin' -BackgroundColor DarkBlue -ForegroundColor White
}
}
```