-
-
Notifications
You must be signed in to change notification settings - Fork 807
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
Error in $profile after poshgit installed? #355
Comments
Are you using latest bits from this repo or the latest poshgit from Chocolatey? If you are using the latest bits from this repo (the not yet released 0.7.0) you can comment out the these lines e.g.: # Rename-Item Function:\Prompt PoshGitPrompt -Force
# function Prompt() {if(Test-Path Function:\PrePoshGitPrompt){++$global:poshScope; New-Item function:\script:Write-host -value "param([object] `$object, `$backgroundColor, `$foregroundColor, [switch] `$nonewline) " -Force | Out-Null;$private:p = PrePoshGitPrompt; if(--$global:poshScope -eq 0) {Remove-Item function:\Write-Host -Force}}PoshGitPrompt} Even if you're not using the latest repo bits, you might try commenting out the lines above. BTW which version of PowerShell are you using (check with |
I would not expect loading For reference, this is what a Chocolatey-installed if(Test-Path Function:\Prompt) {Rename-Item Function:\Prompt PrePoshGitPrompt -Force}
# Load posh-git example profile
. 'C:\tools\poshgit\dahlbyk-posh-git-464601f\profile.example.ps1'
Rename-Item Function:\Prompt PoshGitPrompt -Force
function Prompt() {if(Test-Path Function:\PrePoshGitPrompt){++$global:poshScope; New-Item function:\script:Write-host -value "param([object] `$object, `$backgroundColor, `$foregroundColor, [switch] `$nonewline) " -Force | Out-Null;$private:p = PrePoshGitPrompt; if(--$global:poshScope -eq 0) {Remove-Item function:\Write-Host -Force}}PoshGitPrompt} I'd love for all of this to be replaced in 1.0 with |
Yeah, the code to set Thanks for the bug report, @ewgoforth! |
I'm using the following powershell version:
I am using the latest from chocolatey as of yesterday. If I comment out everything it's normal, but I don't get the posh-git functionality:
|
I would uncomment the second line (by which I mean add a newline after "example profile" and before the |
I did that like so:
and I seem to have the full poshgit functionality. |
So as an action item for this issue, is there something in the Chocolatey package that needs to be tweaked for 0.7.0? Also, just removing those lines probably wouldn't help someone who has a previously (Chocolatey) installed version of poshgit. What should we do there? |
@ewgoforth if you don't mind, could you do a
I believe #357 is technically sufficient, but we have #239 marked for 0.7 so: #358. |
I'm seeing the following message when my $profile gets executed:
here's what the relevant line looks like:
The text was updated successfully, but these errors were encountered: