Skip to content

Commit 7448809

Browse files
committed
debug 'Install resource with a dependency (should install both parent and dependency)'
1 parent 09a63bb commit 7448809

File tree

3 files changed

+412
-372
lines changed

3 files changed

+412
-372
lines changed

test/FindPSResourceTests/FindPSResourceRepositorySearching.Tests.ps1

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -504,33 +504,6 @@ Describe 'Test Find-PSResource for searching and looping through repositories' -
504504
$err[0].FullyQualifiedErrorId | Should -BeExactly "WildcardsUnsupportedForCommandNameorDSCResourceName,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource"
505505
}
506506

507-
It "not find resource and discard CommandName entry containing wildcard, but search for other non-wildcard CommandName entries (without -Repository specified)" {
508-
$res = Find-PSResource -CommandName $cmdName,"myCommandName*" -ErrorVariable err -ErrorAction SilentlyContinue
509-
$err | Should -HaveCount 1
510-
$err[0].FullyQualifiedErrorId | Should -BeExactly "WildcardsUnsupportedForCommandNameorDSCResourceName,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource"
511-
512-
$res.Count | Should -BeGreaterOrEqual 9
513-
$pkgFoundFromLocalRepo = $false
514-
$pkgFoundFromPSGallery = $false
515-
516-
foreach ($pkg in $res)
517-
{
518-
if ($pkg.ParentResource.Repository -eq $localRepoName)
519-
{
520-
$pkgFoundFromLocalRepo = $true
521-
}
522-
elseif ($pkg.ParentResource.Repository -eq $PSGalleryName)
523-
{
524-
$pkgFoundFromPSGallery = $true
525-
}
526-
}
527-
528-
$pkg.Names | Should -Be $cmdName
529-
$pkg.ParentResource.Includes.Command | Should -Contain $cmdName
530-
$pkgFoundFromLocalRepo | Should -BeTrue
531-
$pkgFoundFromPSGallery | Should -BeTrue
532-
}
533-
534507
It "should not allow for repository name with wildcard and non-wildcard command name specified in same command run" {
535508
{Find-PSResource -CommandName $cmdName -Repository "*Gallery",$localRepoName} | Should -Throw -ErrorId "RepositoryNamesWithWildcardsAndNonWildcardUnsupported,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource"
536509
}
@@ -563,31 +536,6 @@ Describe 'Test Find-PSResource for searching and looping through repositories' -
563536
$err[0].FullyQualifiedErrorId | Should -BeExactly "FindCmdOrDSCNamesPackageNotFound,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource"
564537
}
565538

566-
It "find resource given CommandName from all repositories where it exists (-Repository with multiple non-wildcard values)" {
567-
$res = Find-PSResource -CommandName $cmdName -Repository $PSGalleryName,$localRepoName
568-
$res.Count | Should -BeGreaterOrEqual 9
569-
570-
$pkgFoundFromLocalRepo = $false
571-
$pkgFoundFromPSGallery = $false
572-
573-
foreach ($pkg in $res)
574-
{
575-
if ($pkg.ParentResource.Repository -eq $localRepoName)
576-
{
577-
$pkgFoundFromLocalRepo = $true
578-
}
579-
elseif ($pkg.ParentResource.Repository -eq $PSGalleryName)
580-
{
581-
$pkgFoundFromPSGallery = $true
582-
}
583-
}
584-
585-
$pkg.Names | Should -Be $cmdName
586-
$pkg.ParentResource.Includes.Command | Should -Contain $cmdName
587-
$pkgFoundFromLocalRepo | Should -BeTrue
588-
$pkgFoundFromPSGallery | Should -BeTrue
589-
}
590-
591539
It "find resource given CommandName from all repositories where it exists and write errors for those it does not exist from (-Repository with multiple non-wildcard values)" {
592540
# Package with Command "Get-MyCommand" exists in the following repositories: localRepo
593541
$res = Find-PSResource -CommandName $cmdName2 -Repository $PSGalleryName,$localRepoName -ErrorVariable err -ErrorAction SilentlyContinue

0 commit comments

Comments
 (0)