-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
Prompt configuration without editing PowerShell profiles #439
Comments
Interesting... You should only see "Replacing old posh-git prompt. Did you copy profile.example.ps1 into $PROFILE?" if there's an existing
If it does, then you're getting a posh-git |
Also, swap these two lines: Set-Item Function:\prompt -Value $null
Import-Module "$poshGitFolder\src\posh-git.psm1" to Import-Module "$poshGitFolder\src\posh-git.psm1"
Set-Item Function:\prompt -Value $null Importing the posh-git module will not mess with any profile script. There is a separate command for that - |
The existing prompt is the default PS one @dahlbyk:
If I swap the lines as suggested by @rkeithhill the warning is written otherwise not |
And the winner is:
I'm comparing trimmed |
@luigiberrettini try it now? |
Thanks it works 👍 |
System Details
Issue Description
I created my own script to load posh-git on demand:
https://github.com/luigiberrettini/Portable-GitShell/blob/master/New-GitShell.ps1
It worked fine until I cloned the latest posh-git version and I got the following warning:
Replacing old posh-git prompt. Did you copy profile.example.ps1 into $PROFILE?
I would like to avoid modifying PowerShell profiles, because I want to enable posh-git on demand via a Windows shortcut:
C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "& 'C:\SmartGit\New-GitShell.ps1'"
Which configuration should I perform to avoid having that warning (I do not want to simply suppress the warning) and to be compliant with future posh-git versions (that will remove profile.example.ps1)?
At the moment I am using a modified New-GitShell.ps1 in which I set the prompt function to null:
The text was updated successfully, but these errors were encountered: