Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cann't Show status in PowerShell 5.0 on Window 7 #360

Closed
Nonlone opened this issue Jan 7, 2017 · 3 comments
Closed

Cann't Show status in PowerShell 5.0 on Window 7 #360

Nonlone opened this issue Jan 7, 2017 · 3 comments

Comments

@Nonlone
Copy link

Nonlone commented Jan 7, 2017

just like issue #161
I update PowerShell to 5.0 with Managmant Framework and I installed the posh-git in command 'Install-Module posh-git -Scope CurrentUser' but it doesn't show the git status in PowerShell

@rkeithhill
Copy link
Collaborator

rkeithhill commented Jan 7, 2017

The version of posh-git on the PSGallery hasn't been updated in a while. With posh-git 0.7.0 (coming soon) prompt modification will be automatic for most folks that import the module (unless you have already overridden the prompt function).

For now, I recommend you do this. First, from PowerShell, execute notepad $PROFILE to edit (or create) your PowerShell profile. This file is to PowerShell what .bashrc is to Bash.

In notepad, stick in these lines:

Import-Module posh-git
function prompt {
    $origLastExitCode = $LASTEXITCODE
    Write-Host $ExecutionContext.SessionState.Path.CurrentLocation -NoNewline
    Write-VcsStatus
    $LASTEXITCODE = $origLastExitCode
    "> "
}

For more info on this, please see the Using posh-git section of the README file.

When you do update to posh-git 0.7.0, I recommend that you remove the prompt function (but leave the import-module command in your profile).

@Nonlone
Copy link
Author

Nonlone commented Jan 7, 2017

Thank you a lots! It work nice

@dahlbyk
Copy link
Owner

dahlbyk commented Jan 7, 2017

Going to go ahead and close this as fixed by #349. Keep an eye on #327 for the release.

@dahlbyk dahlbyk closed this as completed Jan 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants