How do I download modules manually from gallery behind a firewall/proxy?
For companies like banks which are very restrictive regarding internet downloads, I have no internet connectivity directly from powershell, only from my browsers. As such I cannot use install-module from powershell.
Our desktops are only windows 7 but locked down running ps version 2 and powershell console doesn't have proxy access. I cannot run install-module on my servers neither as my servers have no internet connection.
Is there a workaround to download a module manually as a zipped file so that I can I unzip and install them manually in my server?
Wayne “Gkaruk” commented
Sadly the work around below isn't acceptable for UK Financial institutions. We have strict internet access policies to control and validate any content coming form internet into the company.
For Nuget Packages this isn't and issue as the NuGet repo has a Manual download link. Why cant this be supported by PowerShell Gallery (repo)?
Its seems very illogical to not support one MS repo and not another.
I get the idea to make easy to just use PS to install modules but what about those of us behind company firewalls which don't allow direct download from software apps. We really need the support of a direct download link to the modules available as well.
Currently our team want to use PlatyPS and you provide no way to download it without going through our internal company very lengthy admin security to get the firewall open to allow the downloads directly.
What other options are available to download directly?
Peter J. commented
Register-PackageSource -Name PSGallery -Location https://www.powershellgallery.com/api/v2/ -ProviderName PowerShellGet
$webClient = New-Object System.Net.WebClient
$creds = Get-Credential
$webClient.Proxy.Credentials = $creds
The only way to acquire content from the Gallery is using PowerShellGet module, which does require PS3 or above, and then internet access to get to the Gallery. PowerShellGet does more than copy, it also performs certain validation actions, and ensures all dependencies are also downloaded.
If you can get to a system that meets those requirements, use Save-Module to put the module you want, and all of its dependencies, into a folder on that system. That folder can then be zipped up, or xcopied, to a folder listed in the PSModulePath of the system where the code will be used.