Created
March 28, 2018 01:56
-
-
Save nicholasjackson827/d049de3b4218f90c0b29bbb8fa124cf5 to your computer and use it in GitHub Desktop.
My Sample PowerShell 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
Import-Module posh-git | |
[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding(850) | |
function prompt { | |
# Get the current path, but format it a bit differently | |
$CurrentPath = (pwd).Path | |
$ShortPath = $CurrentPath.Replace($HOME, '~').Replace("\", "/") | |
$ShortPath = $ShortPath -Replace '^[^:]+::', '' | |
# Write out a blank space a neat character first | |
# and an open curly brace (in blue) | |
Write-Host '' | |
Write-Host "$([char]0x0A7) {" -n -f Blue | |
# Write out the ShortPath we made | |
Write-Host $ShortPath -n -f Blue | |
# Close the curly brace and add new line | |
Write-Host '}' -n -f Blue | |
# Write the Git status | |
Write-Host $(Write-VcsStatus) | |
# Write out a double arrow as the prompt | |
return "$([char]0xbb) " | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment