Skip to content

Commit 7864485

Browse files
author
anamnavi
committed
capture information record output from appropriate stream
1 parent 3fe8da9 commit 7864485

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/PublishPSResourceTests/PublishPSResourceContainerRegistryServer.Tests.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,16 +350,15 @@ Describe "Test Publish-PSResource" -tags 'CI' {
350350
$version = "15.0.0"
351351
New-ModuleManifest -Path (Join-Path -Path $script:PublishModuleBase -ChildPath "$script:PublishModuleName.psd1") -ModuleVersion $version -Description "$script:PublishModuleName module"
352352

353-
Publish-PSResource -Path $script:PublishModuleBase -Repository $ACRRepoName -InformationVariable RegistryAuthenticated
353+
$infoRecord = & { Publish-PSResource -Path $script:PublishModuleBase -Repository $ACRRepoName 6>&1 } | Where-Object { $_ -is [System.Management.Automation.InformationRecord] }
354354

355355
$results = Find-PSResource -Name $script:PublishModuleName -Repository $ACRRepoName -InformationVariable FindRegistryAuthenticated
356356
$results | Should -Not -BeNullOrEmpty
357357
$results[0].Name | Should -Be $script:PublishModuleName
358358
$results[0].Version | Should -Be $version
359359

360-
Write-Verbose -Verbose "obj: $RegistryAuthenticated, preference: $InformationPreference, find: $FindRegistryAuthenticated"
361-
$RegistryAuthenticated[0].Tags | Should -Be "PSRGContainerRegistryUnauthenticatedCheck"
362-
$RegistryAuthenticated[0].MessageData | Should -Be "Value of isRepositoryUnauthenticated: False"
360+
$infoRecord[0].Tags | Should -Be "PSRGContainerRegistryUnauthenticatedCheck"
361+
$infoRecord[0].MessageData | Should -Be "Value of isRepositoryUnauthenticated: False"
363362
}
364363

365364
It "Publish a script"{

0 commit comments

Comments
 (0)