File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -457,4 +457,18 @@ Describe 'Test HTTP Find-PSResource for V2 Server Protocol' -tags 'ManualValidat
457457
458458 $duplicatePkgsFound | Should - BeFalse
459459 }
460+
461+ It " find should return an unlisted module when it was requested explicitly by full name and version (i.e no wildcards)" {
462+ # 'test_unlisted' is an unlisted package
463+ $res = Find-PSResource - Name " test_unlisted" - Version " 0.0.1" - Repository $PSGalleryName
464+ $res | Should -Not - BeNullOrEmpty
465+ $res.Version | Should - Be " 0.0.1"
466+ }
467+
468+ It " find should not return an unlisted module with it was requested with wildcards in the name" {
469+ # 'test_unlisted' is an unlisted package whereas 'test_notunlisted' is listed
470+ $res = Find-PSResource - Name " test_*unlisted" - Repository $PSGalleryName
471+ $res.Count | Should - Be 1
472+ $res [0 ].Name | Should - Be " test_notunlisted"
473+ }
460474}
Original file line number Diff line number Diff line change @@ -573,6 +573,16 @@ Describe 'Test Install-PSResource for V2 Server scenarios' -tags 'CI' {
573573 $res | Should -Not - BeNullOrEmpty
574574 $res.Version | Should - Be $version
575575 }
576+
577+ It " Install resource that is unlisted" {
578+ # 'test_unlisted' is an unlisted package
579+ $moduleName = ' test_unlisted'
580+ $version = ' 0.0.1'
581+ Install-PSResource - Name $moduleName - Repository $PSGalleryName - TrustRepository
582+ $res = Get-InstalledPSResource $moduleName
583+ $res | Should -Not - BeNullOrEmpty
584+ $res.Version | Should - Be $version
585+ }
576586}
577587
578588Describe ' Test Install-PSResource for V2 Server scenarios' - tags ' ManualValidationOnly' {
You can’t perform that action at this time.
0 commit comments