Skip to content

Commit a867bca

Browse files
committed
add ErrorVariable reference
1 parent e8213aa commit a867bca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/FindPSResourceTests/FindPSResourceLocal.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Describe 'Test Find-PSResource for local repositories' -tags 'CI' {
150150
# Package $testModuleName version 4.0.0 does not exist
151151
# previously if Find-PSResource -Version against local repo did not find that package's version it kept looking at
152152
# similar named packages and would fault. This test is to ensure only the specified package and its version is checked
153-
$res = Find-PSResource -Name $testModuleName -Version "4.0.0" -Repository $localRepo
153+
$res = Find-PSResource -Name $testModuleName -Version "4.0.0" -Repository $localRepo -ErrorVariable err -ErrorAction SilentlyContinue
154154
$res | Should -BeNullOrEmpty
155155
$err.Count | Should -Not -Be 0
156156
$err[0].FullyQualifiedErrorId | Should -BeExactly "PackageNotFound,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource"

0 commit comments

Comments
 (0)