Skip to content

Commit 5e2b2c6

Browse files
authored
Log more information when MHSM provisioning fails (Azure#28518)
1 parent 160dd14 commit 5e2b2c6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sdk/keyvault/test-resources-post.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,13 @@ if (Test-Path $sdpath) {
9595
Remove-Item $sdPath -Force
9696
}
9797

98-
Export-AzKeyVaultSecurityDomain -Name $hsmName -Quorum 2 -Certificates $wrappingFiles -OutputPath $sdPath
98+
Export-AzKeyVaultSecurityDomain -Name $hsmName -Quorum 2 -Certificates $wrappingFiles -OutputPath $sdPath -ErrorAction SilentlyContinue -Verbose
99+
if ( !$? ) {
100+
Write-Host $Error[0].Exception
101+
Write-Error $Error[0]
102+
103+
exit
104+
}
99105

100106
Log "Security domain downloaded to '$sdPath'; Managed HSM is now active at '$hsmUrl'"
101107

0 commit comments

Comments
 (0)