Skip to content

Instantly share code, notes, and snippets.

@LittleKross
Created September 8, 2020 14:25
Show Gist options
  • Save LittleKross/d62e2e94d87dd1fd9fe062398292e12c to your computer and use it in GitHub Desktop.
Save LittleKross/d62e2e94d87dd1fd9fe062398292e12c to your computer and use it in GitHub Desktop.
How to conditionally set window name for Powershell - Broken
#IF (([Security.Principal.WindowsPrincipal] ` [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
#{
#$host.ui.RawUI.WindowTitle = "Brandon's Powershell - Running as ADMINISTRATOR"
#}
#Else
#{
#$host.ui.RawUI.WindowTitle = "Brandon's Powershell"
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment