PowerShell v5 – How to install modules to a computer having no internet connection?

Question:

I’ve a machine (v3, internet, no admin access) which I used to download WMF 5.0 and set up another machine(v5, no internet, admin access). Now, I want to use some modules from PowerShellGet on the machine running v5 but no internet connection.

I need an option to download *.psm1 file which I can then copy over and use.
Just like we have options to download from GitHub.

Anyone with a similar issue and any workarounds ?

Answer:

Install the Package Management Module on your PowerShell 3 machine, and then use Save-Module …

Or set up ProGet somewhere “on the edge” of your network, and have it mirror the modules you want from the public PowerShellGallery for your internal-only clients.

Failing that, just build your own download URL:

You can even generate an OData proxy module, or just use invoke-restmethod to search:

So now you can just do the same as with the official module:

Source:

PowerShell v5 – How to install modules to a computer having no internet connection? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply