Managing servers in a secure or air-gapped environment presents a unique challenge: how do you install software, modules, and features without an internet connection? The answer is a simple but powerful workflow: use an online “staging” machine to download the necessary assets, transfer them via removable media, and then install them on the offline “target” machine.

This guide provides a comprehensive walkthrough of this “Download, Transfer, Install” method for two of the most common offline scenarios: installing PowerShell modules and installing Windows features like the OpenSSH Server.


Part 1: Installing PowerShell Modules Offline

If you can’t use Install-Module on a machine, you can use an online computer to pre-download the module and its dependencies for a manual transfer.

Step 1: Save the Module on an Online Machine

The Save-Module cmdlet is designed specifically for this purpose. On a machine with internet access, create a staging folder and run the command. We’ll use the Posh-SSH module as an example.

# 1. Create a staging directory

$stagingPath = "$env:USERPROFILE\OfflineModules"

New-Item -Path $stagingPath -ItemType Directory -Force



# 2. Save the module and its dependencies to the directory

Save-Module -Name Posh-SSH -Path $stagingPath

This command connects to the PowerShell Gallery and downloads Posh-SSH and any other modules it depends on into the $stagingPath folder.

Step 2: Transfer the Module Folder

Navigate to your staging folder (C:\Users\YourUser\OfflineModules). You will see a folder for Posh-SSH and any dependencies. Copy these entire folders to a USB drive or other removable media.

Step 3: Install the Module on the Offline Machine

On the offline machine, you need to copy the module folders into a location where PowerShell can find them. You can see these locations by running $env:PSModulePath.

  1. Choose a Module Path:

    • For the current user only (recommended): %USERPROFILE%\Documents\PowerShell\Modules

    • For all users (requires admin rights): %ProgramFiles%\WindowsPowerShell\Modules

  2. Copy the module folders from your USB drive into your chosen path.

Step 4: Verify the Installation

Open a new PowerShell terminal on the offline machine. PowerShell will automatically discover the modules.

# Check if the module is available

Get-Module -Name Posh-SSH -ListAvailable



# Import the module to start using its commands

Import-Module -Name Posh-SSH



# Verify the commands are available

Get-Command -Module Posh-SSH

You have now successfully installed a PowerShell module offline.


Part 2: Installing Software & Features Offline (Example: OpenSSH Server)

The same “Download, Transfer, Install” concept applies to Windows features and software. Let’s use installing the OpenSSH Server as an example.

Step 1: Obtain the Installer on an Online Machine

You have two main options to get the installer.

  • Method A: MSI from GitHub (Recommended for simplicity)

    1. Go to the Win32-OpenSSH GitHub releases page.

    2. Download the latest OpenSSH-Win64-vX.X.X.X.msi file.

  • Method B: CAB File from Features on Demand (FOD) ISO

    1. Download the Language and Optional Features (FOD) ISO from the Microsoft Evaluation Center that exactly matches your Windows Server build.

    2. Mount the ISO and find the OpenSSH Server .cab file (e.g., OpenSSH-Server-Package~...~.cab).

Copy your chosen installer (.msi or .cab) to removable media.

Step 2: Install the Software on the Offline Machine

Transfer the file to the offline machine (e.g., to C:\Temp) and run the appropriate installer from an elevated PowerShell prompt.

  • For the MSI Installer:

    msiexec /i "C:\Temp\OpenSSH-Win64-v9.5.0.0p1-Beta.msi" /quiet /log "C:\Temp\install.log"
  • For the CAB File:

    Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 -Source C:\Temp

Step 3: Post-Installation and Firewall Configuration

The installation is complete, but you still need to start the service and open the firewall port.

# Start the service and set it to start automatically

Start-Service -Name sshd

Set-Service -Name sshd -StartupType Automatic



# Allow inbound traffic on port 22

New-NetFirewallRule -Name "OpenSSH Server (sshd)" -DisplayName "OpenSSH Server (sshd)" `

    -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22

Your offline OpenSSH server is now installed and ready for connections.


Conclusion

Managing air-gapped systems doesn’t have to be a headache. By mastering the simple “Download, Transfer, Install” workflow, you can reliably install almost any PowerShell module or Windows feature.

The key is to use the online machine to stage all the necessary files—whether using Save-Module for PowerShell modules or downloading MSI/CAB installers for software—so that the offline installation is a simple, predictable copy-and-run process.