Skip to content

Instantly share code, notes, and snippets.

@mrcaron
Created January 20, 2010 17:16
Show Gist options
  • Save mrcaron/282014 to your computer and use it in GitHub Desktop.
Save mrcaron/282014 to your computer and use it in GitHub Desktop.
Powershell prompt
# Powershell Prompt
$global:CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent()
function prompt
{
$un = [Regex]::Match($CurrentUser.Name,"SOLIDWORKS\\+(.*)").Groups[1].Value
$hn = [Net.DNS]::GetHostName()
$host.ui.rawui.WindowTitle = $un + "@" + $hn #+ " Line: " + $host.UI.RawUI.CursorPosition.Y
Write-Host($un + "@" + $hn + " ") -foregroundcolor Green -nonewline; Write-Host ($(get-location)) -foregroundcolor Yellow
Write-Host(">") -nonewline -foregroundcolor Green
return " "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment