Skip to content

Commit e7551d6

Browse files
More debug 2
1 parent 11a1060 commit e7551d6

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

test/FindPSResourceTests/FindPSResourceContainerRegistryServer.Tests.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ Describe 'Test HTTP Find-PSResource for ACR Server Protocol' -tags 'CI' {
4040
It "Find resource given specific Name, Version null" {
4141
# FindName()
4242
Write-Verbose -Verbose "Finding resource with Name: $testModuleName"
43-
$res = Find-PSResource -Name $testModuleName -Repository $ACRRepoName -Verbose -Debug -ErrorAction Stop
4443

45-
if ($Error.Count -gt 0) {
46-
Write-Error "Error occurred while finding resource: $($Error[0])"
44+
try {
45+
$res = Find-PSResource -Name $testModuleName -Repository $ACRRepoName -Verbose -Debug -ErrorAction Stop
46+
}
47+
catch {
48+
Write-Error "Error occurred while finding resource: $_"
4749
Get-Error
4850
}
4951

@@ -54,6 +56,7 @@ Describe 'Test HTTP Find-PSResource for ACR Server Protocol' -tags 'CI' {
5456

5557
It "Should not find resource given nonexistant Name" {
5658
# FindName()
59+
Write-Verbose -Verbose "Moved to the next test case to find non-existant resource"
5760
$res = Find-PSResource -Name NonExistantModule -Repository $ACRRepoName -ErrorVariable err -ErrorAction SilentlyContinue
5861
$res | Should -BeNullOrEmpty
5962
$err.Count | Should -BeGreaterThan 0

0 commit comments

Comments
 (0)