posh-git
posh-git copied to clipboard
Allow overriding $PROFILE file in Chocolatey installer
System Details
- posh-git version/path: 0.7.3.1 C:\tools\poshgit\dahlbyk-posh-git-9bda399\src
- PowerShell version: 5.1.17134.112
- git version 2.18.0.windows.1
- OS: Microsoft Windows NT 10.0.17134.0
Issue Description
I notice in chocolateyInstall.ps1
for the posh-git Chocolatey package. That the install script uses the following:
if ($PROFILE -and (Test-Path $PROFILE)) {
Write-Verbose "Updating posh-git location in `'$PROFILE`'."
$oldProfile = @(Get-Content $PROFILE)
It'd be really handy to be able to use Chocolatey package parameters or an Environment variable.
Would you like to specify an exact path, or one of the named $PROFILE
locations (CurrentUserAllHosts
, etc)?
In my case the exact path would be more useful since I split my profile up a bit so I'd point posh-git to $env:USERPROFILE\Documents\WindowsPowerShell\Profile_PoshGit.ps1
.
Interesting. Supporting an environment variable to override the posh-git install location seems the easiest option to let the setting propagate all the way down into Add-PoshGitToPrompt
.