Skip to main content

Copying Packages to Offline PC

Here's some instructions for how to get packages into a PC that doesn't have internet access.

NOTE: This requires a PC with similar OS vintage, having internet access.

From the PC with internet access, create a temp folder, like: C:\Temp\Powershell

Use this to download packages to the PC:

$ModuleCache = "C:\Temp\PowerShell"

New-Item -ItemType Directory -Path $ModuleCache -Force | Out-Null

# This will pull down VMWare VSphere client tools.
Save-Module VMware.PowerCLI  -Path $ModuleCache
# This will pull down client tools for SQL Server.
Save-Module SqlServer        -Path $ModuleCache
Save-Module dbatools         -Path $ModuleCache
# This will pull down mocking tools.
Save-Module Pester           -Path $ModuleCache
# THis will pull down standard package management module for PowerShell.
Save-Module PowerShellGet    -Path $ModuleCache
# This will pull down the core PowerShell module that acts as a manager or "multiplexor" for software package managers.
Save-Module PackageManagement -Path $ModuleCache

NOTE: Powershell modules live in this folder on a PC: C:\Program Files\WindowsPowerShell\Modules
But, the folder is inside Program Files. And, Windows won't let you paste into it from off-box.
So, you must copy the modules to a staging folder on the VM, first. Then, copy them into the above path.