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

One Response to More prompts

  • CrazyDave says:

    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)”
    “☢ ”

Leave a Reply