File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -338,4 +338,15 @@ Describe 'Test Find-PSResource for local repositories' -tags 'CI' {
338338 $res.Version | Should - Be $nupkgVersion
339339 $res.Prerelease | Should - Be $prereleaseLabel
340340 }
341+
342+ It " find module that has multiple manifests and use exact name match one" {
343+ # Az.KeyVault has 2 manifest files - Az.KeyVault.psd1 and Az.KeyVault.Extension.psd1
344+ # this test was added because PSResourceGet would previously pick the .psd1 file by pattern matching the module name, not exact matching it
345+ # this meant Az.KeyVault.Extension.psd1 and its metadata was being returned.
346+ # The package is present on PSGallery but issue reproduces when looking at the package's file paths in local repo
347+ $PSGalleryName = Get-PSGalleryName
348+ Save-PSResource - Name ' Az.KeyVault' - Version ' 6.3.1' - Repository $PSGalleryName - AsNupkg - Path $localRepoUriAddress - TrustRepository
349+ $res = Find-PSResource - Name ' Az.KeyVault' - Repository $localRepo
350+ $res.Version | Should - Be " 6.3.1"
351+ }
341352}
You can’t perform that action at this time.
0 commit comments