Skip to content

Instantly share code, notes, and snippets.

@factormystic
Created May 19, 2016 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save factormystic/87cdd8d9887911e23a36435fe97a006d to your computer and use it in GitHub Desktop.
Save factormystic/87cdd8d9887911e23a36435fe97a006d to your computer and use it in GitHub Desktop.
my custom powershell prompt
# open your profile.ps1 and paste this in
# easiest way:
# > youreditorprogram.exe $profile
function Prompt {
$path = $(Get-Location).Path
if ($path.StartsWith($HOME, "CurrentCultureIgnoreCase")) {
$path = "~"+ $path.Substring($HOME.Length)
}
$time = $(Get-Date -Format t)
Write-Host "`n🌈[$time] [" -NoNewline
Write-Host $path -NoNewline -Foreground blue
Write-Host "]"
return "$ ";
}
# usage: > . $Reload-Profile
function Reload-Profile {
@(
$Profile.AllUsersAllHosts,
$Profile.AllUsersCurrentHost,
$Profile.CurrentUserAllHosts,
$Profile.CurrentUserCurrentHost
) | % {
if(Test-Path $_){
Write-Verbose "Running $_"
. $_
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment