Skip to content

Instantly share code, notes, and snippets.

@bigsby-exe
Created June 27, 2019 21:38
Show Gist options
  • Save bigsby-exe/1813c2e7e1754de2c801ae50377742bb to your computer and use it in GitHub Desktop.
Save bigsby-exe/1813c2e7e1754de2c801ae50377742bb to your computer and use it in GitHub Desktop.
PoSH profile
function Prompt {
Write-Host '[' -NoNewline
Write-Host (Get-Date -Format "HH:mm tt") -ForegroundColor Green -NoNewline
Write-Host '] ' -NoNewline
[string]$dir = Get-Location
if ($dir.startswith("Microsoft.PowerShell.Core\FileSystem::")){
$dir = ($dir -split "FileSystem::" | select -Last 1 ).trim()
$last = ($dir -split "\\" | select -Last 1).trim()
$first = $dir -replace "$last",""
Write-Host -NoNewline $first
Write-Host $last -NoNewline -ForegroundColor Yellow
}else{
Write-Host -NoNewline (Split-Path -path (Get-Location))
Write-Host -NoNewline "\"
Write-Host -NoNewline (Split-Path (Get-Location) -Leaf) -ForegroundColor Yellow
}
return " » "
}
$today = Get-Date -UFormat "%A, %B, %Y"
$ui = "$env:USERNAME@$env:COMPUTERNAME | $today"
$Host.UI.RawUI.WindowTitle = $ui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment