Trouble installing posh-git

Question:

I want to install posh-git on laptop but when I try installing w/command “PowerShellGet\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force” I get error:

Reading the errata at the github site I see it says I need to update my PowerShellGet module w/ “Install-Module PowerShellGet -S
cope CurrentUser -Force -AllowClobber” But this gives error :

I have googled and tried several ways to update PowerShellGet from v1.0.0.1 which shows on my laptop, all to no avail. Any advice on how to rectify this would be much appreciated.

Answer:

The error is specific. You are using a parameter / switch that does not exist by default for modules.

As per the docs:

Prerelease Versioning Added to PowerShellGet and PowerShell Gallery

Developers have to add this or it’s not available for use.

Publishers simply add the prerelease string (ie. the part that comes
after “2.0.0”) in the metadata, and the version will be considered
prerelease. For example:

This…

… is also not the common way (that I am aware of) regarding how you install a module. You should only need the Install-Module cmdlet, PowerShell already knows the module it comes from and autoloads that, if not already loaded.

Try this…

Source:

Trouble installing posh-git by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply