Weved
Weved

Reputation: 823

How to install PoshRSJob module offline?

I using PoshRSJob module in my powershell application.

How can I install this module to other machine (windows) without having internet connection (offline)?

Upvotes: 1

Views: 559

Answers (2)

Maximilian Burszley
Maximilian Burszley

Reputation: 19664

I'd recommend what @4c74356b41 said in that you can save the module with an internet connection using

Save-Module -Name PoshRSJob -Path C:\Temp\ -Force

But I'd recommend using Install-Module after you have it on the target PC as such:

$registerPSRepoArgs = @{
    InstallationPolicy        = 'Trusted'
    Name                      = 'tmp'
    PackageManagementProvider = 'NuGet'
    SourceLocation            = 'C:\Temp'
}
Register-PSRepository @registerPSRepoArgs
Install-Module -Name PoshRSJob -Force -Scope AllUsers -Repository tmp
Unregister-PSRepository -Name tmp

This will treat the package as if it came from the repository and handle any necessary setup so you don't have a bad configuration for whatever reason. The SourceLocation is wherever you would drop the PoshRSJob folder you download using Save-Module.

Upvotes: 0

4c74356b41
4c74356b41

Reputation: 72171

You can use Save-Module to save module to a local folder on a PC that has connection to internet and copy it to the PC without internet and put in into a PSModulePath directory

Save-Module PoshRSJob -Path %path%

Upvotes: 1

Related Questions