Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Did anyone managed to get PSResourceGet working with a PowerShellGallery mirror on Sonatype Nexus OSS? #1717

Unanswered
OCram85 asked this question in Q&A
Discussion options

We really would like to migrate from PowerShellGet v2 to PSResourceGet for these 2 use-cases:

  • Using an internal Repository for own PowerShell modules (NuGet v2 based)
  • Using a PowerShellGallery Mirror for a centralized internal endpoint for external modules.

Up to now I could deploy these repos by grouping them like this:

Register-PSRepository -Name 'Nexus' `
 -SourceLocation 'https://nexus.ocram85.com/repository/PSGroup/' `
 -PublishLocation 'https://nexus.ocram85.com/repository/PSModulesRepo/' `
 -InstallationPolicy 'Trusted' -Verbose

But querying the PowerShellGallery mirror with FindPS-Resource doesn't work fully. When searching for module like 'Pester' it returns the wrong elements:

Register-PSResourceRepository -Name 'Nexus' -Uri 'https://nexus.ocram85.com/repository/PSGallery' -Trusted -Priority 10 -ApiVersion v2 
Find-PSResource -Name Pester -Verbose -Repository 'Nexus' -Debug 
---
DEBUG: In FindPSResource::ProcessResourceNameParameterSet()
DEBUG: Filtering package name(s) on wildcards
DEBUG: In FindHelper::FindByResourceName()
DEBUG: Parameters passed in >>> Name: 'Pester'; ResourceType: 'None'; VersionRange: ''; NuGetVersion: ''; VersionType: 'NoVersion'; Version: ''; Prerelease: 'False'; Tag: ''; Repository: 'Nexus'; IncludeDependencies 'False'
DEBUG: Searching through repository 'Nexus'
DEBUG: In FindHelper::SearchByNames()
DEBUG: No version specified, package name is specified
DEBUG: In V2ServerAPICalls::FindName()
DEBUG: In V2ServerAPICalls::HttpRequestCall()
DEBUG: Request url is 'https://nexus.ocram85.com/repository/PSGallery/FindPackagesById()?id='Pester'&$inlinecount=allpages&$filter=IsLatestVersion and Id eq 'Pester''
DEBUG: Found package 'Pester' version '3.0.3'
DEBUG: Package 'Pester' returned from server
DEBUG: Package 'Pester' was previously discovered and returned
Name Version Prerelease Repository Description
---- ------- ---------- ---------- -----------
Pester 3.0.3 Nexus Pester provides a framework for running BDD style Tests to execute and validate PowerShell commands inside of PowerShell and offers a powerful set of Mocking Functions that allow tests to mimic and mock the functio...

Did anyone tested using Publish-PSResource to upload PowerShell module to such a repository? - Does nuget v2 still work?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /