Install PowerShell modules offline

There are many possible ways in which you can install a PowerShell module and most of us are probably using the nuget package manager to achieve this. But what if you want to install a PowerShell module without having access to the internet on a particular machine?

 

First of all, on a machine with internet access, find your desired module. For this example we are going to use the Firewall-Manager module.

Once we know how our module is called, open up PowerShell and download the module somewhere on the machine with Save-Module:

Save-Module Firewall-Manager -path C:\temp

This will download the entire module into C:\Temp. If the Save-Module outputs any error, try to first install the PowerShellGet:

Import-module PowerShellGet

Next, copy the folder which was downloaded to C:\Temp to C:\Program Files\WindowsPowerShell\Modules

Copy-Item ‘C:\temp\Firewall-Manager’ ‘C:\Program Files\WindowsPowerShell\Modules’ -Recurse

Note: If you copy the module into “C:\Program Files\…” this will make it available for all the users on the machine. If you want the module to be accessed only by a particular user, this must be copied into “C:\Users\THEUSERNAME\Documents\WindowsPowerShell\Modules”.



At the end, you should have a structure something like this:

The final step is to import the module in PowerShell by using the following command:

Import-Module Firewall-Manager

Because all the necessary files are already located in the “Modules” folder, PowerShell will install it from there, not requiring an internet connection.

If we refresh the commands in PowerShell ISE after installation, the additional cmdlets should appear

 

Sharing is caring!

Leave a comment

Your email address will not be published. Required fields are marked *

2 × two =