Updated the manuals

This commit is contained in:
Markus Fleschutz
2024-08-15 09:51:46 +02:00
parent 654d1a18d0
commit e1ffab5509
633 changed files with 2120 additions and 973 deletions

View File

@ -17,7 +17,7 @@ Example
-------
```powershell
PS> ./check-admin.ps1
Yes
Yes, Markus has admin rights.
```
@ -39,7 +39,7 @@ Script Content
This PowerShell script checks if the user has administrator rights.
.EXAMPLE
PS> ./check-admin.ps1
✅ Yes
✅ Yes, Markus has admin rights.
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -53,18 +53,18 @@ try {
$user = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = (New-Object Security.Principal.WindowsPrincipal $user)
if ($principal.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) {
"✅ Yes"
"✅ Yes, $USERNAME has admin rights."
} elseif ($principal.IsInRole([Security.Principal.WindowsBuiltinRole]::Guest)) {
"⚠️ No, guest rights only"
"⚠️ No, $USERNAME, has guest rights only."
} else {
"⚠️ No, normal user rights only"
"⚠️ No, $USERNAME has normal user rights only."
}
}
exit 0 # success
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
"⚠️ Error: $($Error[0]) (in script line $($_.InvocationInfo.ScriptLineNumber))"
exit 1
}
```
*(generated by convert-ps2md.ps1 using the comment-based help of check-admin.ps1 as of 05/19/2024 10:25:17)*
*(generated by convert-ps2md.ps1 using the comment-based help of check-admin.ps1 as of 08/15/2024 09:50:45)*