Skip to content

Commit 86a951b

Browse files
committed
add test for Az.KeyVault
1 parent 4667333 commit 86a951b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/FindPSResourceTests/FindPSResourceLocal.Tests.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)