How to Install PowerShell Modules Offline


Sometimes you need to install a PowerShell module on a machine that doesn’t have internet access—maybe due to strict firewall rules, isolated networks, or security policies. In these cases, you can perform an offline installation of the PowerShell module. This guide will walk you through the process step by step.


Why Offline Installations?

  • Air-gapped environments – Systems disconnected from the internet for security reasons.
  • Corporate restrictions – Firewalls or proxies blocking the PowerShell Gallery.
  • Repeatable deployments – Ensuring consistent versions across multiple servers without always reaching out to the internet.

Step 1: Identify the Module and Version

On a machine with internet access, decide which module and version you need. For example, let’s say we want to install the NetApp.ONTAP module.

# Check latest version available online Find-Module -Name NetApp.ONTAP -Repository PSGallery

Step 2: Download the Module to a Local Folder

Use the Save-Module cmdlet to download the module files:

# Create a folder to store downloaded modules New-Item -ItemType Directory -Path "C:\PSModules\NetApp.ONTAP" -Force # Download the NetApp.ONTAP module and its dependencies Save-Module -Name NetApp.ONTAP -Path "C:\PSModules\NetApp.ONTAP" -Repository PSGallery

This command will fetch the module and place it inside C:\PSModules\NetApp.ONTAP.


Step 3: Transfer the Module to the Offline Machine

Use USB, secure copy (SCP), or another method to move the downloaded module folder from the internet-connected machine to your offline environment. Place it in one of the recognized PowerShell module paths.

Common default paths are:

  • All users: C:\Program Files\WindowsPowerShell\Modules
  • Current user only: C:\Users\<username>\Documents\WindowsPowerShell\Modules

For PowerShell 7 (Core):

  • All users: C:\Program Files\PowerShell\7\Modules
  • Current user: C:\Users\<username>\Documents\PowerShell\Modules

Step 4: Import and Verify the Module

Once copied, load the module into your session:

Import-Module NetApp.ONTAP

Verify it’s available:

Get-Module -Name NetApp.ONTAP -ListAvailable

If you see the module listed, the offline installation was successful. 


Step 5 (Optional): Register a Custom Local Repository

If you frequently need to install modules offline, you can set up your own internal repository (using a network share or an internal NuGet server).

Example with a simple network share:

# Register internal repo Register-PSRepository -Name LocalRepo -SourceLocation \\fileserver\psmodules -InstallationPolicy Trusted # Save module into repo Save-Module -Name NetApp.ONTAP -Path \\fileserver\psmodules # Install module from repo Install-Module -Name NetApp.ONTAP -Repository LocalRepo

This makes the offline process much easier across multiple machines.

No comments

Theme images by chuwy. Powered by Blogger.