Description
@dscho reached out to me about bundling posh-git with Git for Windows, which I certainly support.
My tentative suggestion would be to have the Git for Windows installer detect a supported PowerShell version (see dahlbyk/posh-git#328 for version support discussion). If available, launch PowerShell to execute a script that runs Install-Module
(included in 5.0+, or via PackageManagement PowerShell Modules Preview, if available.
Do you have any way to install it system-wide? (Git for Windows installs system-wide, therefore installing posh-git for the installing user would be a little unfortunate.)
Install-Module accepts a -Scope
parameter of either CurrentUser
or AllUsers
(paths). I assume the Git for Windows installer would be able to spawn an elevated shell to install with AllUsers
.
The other part of installation is to inject Import-Module posh-git
into a PowerShell profile, which can be one of:
- Current User, Current (Default) Host
- Current User, All Hosts
- All Users, Current (Default) Host
- All Users, All Hosts
posh-git's Add-PoshGitToProfile
supports -AllHosts
but does not support toggling CurrentUser
/AllUsers
.
Also: what's your release cadence? Would you like to coordinate with Git for Windows releases, or are you fine with me simply picking up the latest posh-git whenever I see a new one?
Release cadence is....infrequent? I'd just let PowerShellGet install the latest for the given platform.