Skip to content
KBHost
Menu
KBHost
FileHost
Home
/
Knowledgebase
/
PowerShell & CMD
/
Snippets
/
Start elevated prompt from PowerShell
Start elevated prompt from PowerShell
# Elevate to Admin privileges param([switch]$Elevated) function Check-Admin { $currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent()) $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) } if ((Check-Admin) -eq $false) { if ($elevated) { # could not elevate, quit } else { Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition)) } exit }
Random passwords
Jico6811?
Dupi1134?
Meyu2579?
Noli8115!
Muli7168?
Most recent
Add entry to end of hosts file
Back-up TrueNAS config to Nextcloud
Nextcloud occ usage example
Add new user
Silent upgrade to Windows 10
New Active Directory User
Most viewed
Cleanup space in CertLog folder
Disable shared mailbox caching OST
Manual update FreeNAS
Ookla Speedtest server install
Flush DNS cache FRITZ!Box
Enable NFS client in Windows 10