More prompts

In this post http://msmvps.com/blogs/richardsiddaway/archive/2013/07/21/fun-with-prompts.aspx 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:

Comments

# 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

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