Skip to content

Commit 392af20

Browse files
committed
Print inner exceptions for profile module test
1 parent 5d59732 commit 392af20

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ResourceManager/Profile/Commands.Profile.Test/ProfileModuleTests.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,20 @@ function Test-LoadProfileModule
2222
$global:pushedProfileModule = $(Get-Module AzureRM.Profile).Path
2323
Remove-Module AzureRM.Profile
2424
try {
25-
Register-PSRepository -Name "ProfileModuleTest" -SourceLocation (Resolve-Path .\).Path -InstallationPolicy Trusted
25+
Register-PSRepository -Name "ProfileModuleTest" -SourceLocation (Resolve-Path .\FakeModuleRepo).Path -InstallationPolicy Trusted
2626
try {
2727
Install-Module AzureRM.ApiManagement -Scope CurrentUser -Repository ProfileModuleTest -RequiredVersion 998.9.8
2828
$global:buffer = Import-Module $global:pushedProfileModule 2>&1 3>&1 | Out-String
2929
Write-Warning $global:buffer
3030
Assert-True { $global:buffer -Like "*AzureRM.ApiManagement 998.9.8 is not compatible with AzureRM.Profile*" }
31+
} catch [system.exception] {
32+
Write-Error $_ -ErrorAction Continue
3133
} finally {
3234
Uninstall-Module AzureRM.ApiManagement -ErrorAction Ignore
3335
Uninstall-Module AzureRM.Profile -ErrorAction Ignore
3436
}
37+
} catch [system.exception] {
38+
Write-Error $_ -ErrorAction Continue
3539
} finally {
3640
Unregister-PSRepository -Name "ProfileModuleTest"
3741
}

0 commit comments

Comments
 (0)