More prompts

In this post I showed some of the things you can do to change the prompt in PowerShell.  I now use £> as my prompt.

What I hadn’t realised is that there is a PowerShell help file:

get-help about_Prompts

It builds on the information in my post including information on how the prompt changes when you enter a remote session

Published Mon, Aug 12 2013 22:37 by RichardSiddaway
Filed under:


# re: More prompts

I use "☢" as my prompt:

if ([System.IntPtr]::Size -eq 8) {$size = '64'}

else {$size = '32'}

$currentUser = [Security.Principal.WindowsIdentity]::GetCurrent()

$secprin = New-Object Security.Principal.WindowsPrincipal $currentUser

if ($secprin.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator))

{$admin = 'Administrator'}

else {$admin = 'non-Administrator'}

$host.ui.RawUI.WindowTitle = "$admin [x$size] : $(get-location)"

"☢ "

Tuesday, August 13, 2013 7:51 AM by CrazyDave

Leave a Comment

If you can't read this number refresh your screen
Enter the numbers above: