Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
  2.  
  3. Import-Module posh-git
  4.  
  5. function global:prompt {
  6.  
  7. $realLASTEXITCODE = $LASTEXITCODE
  8.  
  9. Write-Host("")
  10.  
  11. Write-Host([Environment]::MachineName + ": ") -nonewline -foregroundcolor "gray"
  12.  
  13. # Creates a unix-like home path.
  14. $a = $pwd.ProviderPath -replace [regex]::Escape($env:USERPROFILE), "~"
  15. Write-Host($a) -nonewline
  16.  
  17. Write-VcsStatus
  18.  
  19. $global:LASTEXITCODE = $realLASTEXITCODE
  20.  
  21. return " $ "
  22.  
  23. }
  24.  
  25. Pop-Location
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement