LLI Wiki — My Digital Knowledge Base

Create a local PowerShell repository and install a module from it

Register a local folder as a PowerShell repository and install a module from a .nupkg package.

A local PowerShell repository lets you install a module without using the PowerShell Gallery, for example from a .nupkg package downloaded in advance.

Prepare the package

Place the module's .nupkg file in a local folder, for example C:\PSRepo\. The file name must match the module (example: ps7zip.nupkg).

Register the repository

Unregister-PSRepository -Name LocalRepo
Register-PSRepository -Name LocalRepo -SourceLocation C:\PSRepo\ -InstallationPolicy Trusted

The first command returns an error if the repository is not registered yet; the error can be ignored.

Install the module

Install-Module -Name ps7zip -Repository LocalRepo -Scope AllUsers -Force

Notes

Mastodon LLIMastodon SocialFosstodon