Uncategorized · January 9, 2021 0

Transfer Modules to an offline PC

Hi,

in these days PowerShell Modules are often available to be installed online from PowerShell Gallery or as a from a (NuGet) Repository.

In companies may exists computers which does not have an active internet connection. But how to install the modules on these devices?

It’s possible by simply copying some folders 🙂

In this example I will install some PowerShell module from Powershell Gallery on a computer with access to the internet, then I will show you what to copy and transfer to an offline computer. So lets get started : )

First of all, install whatever Module available online, and accept the installation by hitting yes to all. Below you see I have installed PSWindowsAdmincenter Module

Powershell has multiple folders where modules are installed to. This “oneliner” list all subfolders under the Powershell module locations:

$env:PSModulePath.Split(“;”) | %{if(Test-Path $_){get-Item ($_+”\*”)}}

Launch windows explorer and Find the modules you want to transfer and copy all Modules folders to the new machine in the same folder “C:\Program Files\WindowsPowerShell\Modules”.  in my case I am copying the PSWindowsAdminCenter Powershell Modules Folder

When the copy process has finished close all powershell instances at the “offline” PC and reopen it. Powershell reads all module information at startup.

after that you can use the command Import-Module followed by the name of the Powershell Module you have copied on the offline machine and it should be loaded successfully!

Thats it

Happy Working

Jaber

Close Bitnami banner
Bitnami