Created
June 27, 2019 21:38
-
-
Save bigsby-exe/1813c2e7e1754de2c801ae50377742bb to your computer and use it in GitHub Desktop.
PoSH profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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