about_LibGit2_Installation

LibGit2 can be installed from the PowerShell gallery, with Chocolatey, and NuGet.

Install From Powershell Gallery

To install from the PowerShell Gallery, you must be running PowerShell 5 or PowerShell 4 with the PowerShellGet module installed. If so, run:
PS> Install-Module -Name 'LibGit2'

You can now import LibGit2 by running:

PS> Import-Module 'LibGit2'

Install With Chocolatey

To install with Chocolatey, you'll need Chocolatey installed. With Chocolatey installed, run:

PS> choco install LibGit2.PowerShell

This will install LibGit2 into one of PowerShell's module paths. You can now import LibGit2 by running:

PS> Import-Module 'LibGit2'

Install With Nuget

To install with NuGet, you'll need NuGet installed. With NuGet installed, run:

PS> nuget install LibGit2.PowerShell

This will create a LibGit2.X.Y.Z directory in your current directory (or the output directory you specified with Nuget's OutputDirectory parameter). You can import LibGit2 from that directory using the `Import-LibGit2.ps1 script:

PS> .\LibGit2.X.Y.Z\LibGit2\Import-LibGit2.ps1

Or with PowerShell's Import-Module command:

PS> Import-Module '.\LibGit2.X.Y.Z\LibGit2'

If you want LibGit2 available so you can run Import-Module LibGit2, copy the LibGit2.X.Y.Z\LibGit2 directory into one of PowerShell's module paths. This command will give you a list:

PS> $env:PSModulePath -split ';'

See Also