powershell script to show git info and just the working directory -


I got some goggles and got a solution, so I was expecting some help here.

I have installed POSH-GIT to use with power-shell and want to continue the GIT status which adds to the prompt line, but I do not want to print the entire working directory because Its annoying I just want the current folder Ive received the code to each, but they have not figured out how to combine them.

Default POSH-GIT path and GIT information is printed

  function global: prompt {$ realLASTEXITCODE = $ LASTEXITCODE # Reset color, which is enabled by host $ GitColors Can be messed up. UI.RawUI.ForegroundColor = $ GitPromptSettings.DefaultForegroundColor Write-Host ($ pwd.ProviderPath) -Nineline -VCSStatus $ Global: LASTEXITCODE = $ REALLASTEXITCODE Return "& gt;"}   

The path to print the current folder in the path is

  function prompt {'PS' + ($ Pwd -split '\\') [0] + '' + $ (($ pwd) -split '\\') [- 1] -Join '\') + '& gt;   

I tried many mates of both of them and I came to know what I want to do.

There is a picture to help paint it P>

= $ LASTEXITCODE Reset # color, which can be messed up by the enabled GitColors $ Host.UI.RawUI.ForegroundColor = $ GitPromptSettings.DefaultForegroundColor Write-Host (Split-Path -L F. pwd.ProviderPath) -Nonline Type- VCSStatus $ Global: LASTEXITCODE = $ realLASTEXITCODE Return "& gt;"}

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -