Module-Management: Install module from local repository

Product: PowerShell Universal
Version: 3

Would it be possible to add other (local) repositories beside the PSGallery to the module management interface?

2 Likes

PSU will actually locate registered package sources and display them in the UI.

Hi,
taken a look into it after the weekend… Seems that the integrated environment does not like the already installed nuget provider… As the machine is seperated from direct internet I’ve installed the Package Provider manually. A test script run from a normal PWSH environment works fine, but run in the integrated does not:

> Get-PackageProvider -ListAvailable
 Name                     Version          DynamicOptions 
 ----                     -------          -------------- 
 PowerShellGet            2.2.4.1          PackageManagementProvider, Type, Sco… 
 PowerShellGet            1.0.0.1           

> dir "C:\Program Files\PackageManagement\ProviderAssemblies" -Recurse |Select-Object -Property fullname
 FullName : C:\Program Files\PackageManagement\ProviderAssemblies\nuget 
 FullName : C:\Program  
            Files\PackageManagement\ProviderAssemblies\nuget\2.8.5.208 
 FullName : C:\Program Files\PackageManagement\ProviderAssemblies\nuget\2.8.5.20 
            8\Microsoft.PackageManagement.NuGetProvider.dll 


> Import-PackageProvider -Name NuGet
[error] No match was found for the specified search criteria and provider name 'NuGet'. Try 'Get-PackageProvider -ListAvailable' to see if the provider exists on the system. 

Currently I’m using an Install-Module.ps1 using a “Not-Integrated” environment and everything works fine.

Any idea how to persuade the integrated environment to cooperate?

-Sascha

1 Like

Also why use PackageManagement instead of the PS Repository/PowerShellGet?

Hi,
now I’m completely stumped, got me on the wrong foot with this question :wink:

For me Find-Module and Install-Module come both from PowershellGet. As said everything works from any normal Powershell session (7.2.6 or 5.1), just the integrated env answers my Find-Module call with
[error] NuGet provider is required to interact with NuGet-based repositories. Please ensure that '2.8.5.201' or newer version of NuGet provider is installed.

As the system is without internet access I’ve installed the necessaries following articles like How to get PowerShellGet working with no Internet access - Intrepid Integration

PSU uses the v3 of PSGet which is why the behavior is probably different. PSGetv3 doesn’t use the whole bootstrapped NuGet thing anymore and that’s why we included it in PSU.

I’m not 100% sure why this wouldn’t be working as expected in your encironment but logs may have some more info

Hi Adam,
that was the missing link :wink: PowershellGet 3

Never used the new version up till now, after using Register-PSResourceRepository instead of Register-PSRepository my local repos show up under Plattform/Modules within the admin console.

Thanks.

Possible reason for the errors:
As I see PsGet 3 uses completely new commands, and as the integrated env loads v3 directly the later loaded v2 may run in errors.

Taking a (third) look at the online documentation compresses the whole thread into a RTFM :face_with_head_bandage:

Sorry for that, I vow to improve…

as an addition to this, is this modules tab in the dashboard details still valid, or are all modules loaded at the platform level?
image