Skip to content

Instantly share code, notes, and snippets.

@bzyg7b bzyg7b/profile.ps1
Created Jun 27, 2019

What would you like to do?
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
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
You can’t perform that action at this time.