Created
May 19, 2016 01:29
-
-
Save factormystic/87cdd8d9887911e23a36435fe97a006d to your computer and use it in GitHub Desktop.
my custom powershell prompt
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
# 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