From 818637c9b9c33677bf91f037afd20b142dfe1911 Mon Sep 17 00:00:00 2001 From: Seif Bassem <38246040+sebassem@users.noreply.github.com> Date: Mon, 9 Oct 2023 10:48:10 +0300 Subject: [PATCH] add more error handling --- .../Invoke-RegisterSubscriptionResourceProviders.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scripts/Invoke-RegisterSubscriptionResourceProviders.ps1 b/src/scripts/Invoke-RegisterSubscriptionResourceProviders.ps1 index 8248eb16..8ef3e83c 100644 --- a/src/scripts/Invoke-RegisterSubscriptionResourceProviders.ps1 +++ b/src/scripts/Invoke-RegisterSubscriptionResourceProviders.ps1 @@ -43,6 +43,11 @@ if ($providers.Count -gt 0) { } catch { Write-Output "`n There was a problem registering the '$provider' provider. Please make sure this provider namespace is valid" + $failedProviders += ",$provider" + if ($failedProviders.length -gt 0) { + $output = $failedProviders.substring(1) + } + $DeploymentScriptOutputs["failedProvidersRegistrations"] = $output } # Registering resource providers features $features = $providers[$provider] @@ -75,6 +80,11 @@ if ($providers.Count -gt 0) { } catch { Write-Output "`n There was a problem registering the '$feature' feature. Please make sure this feature name is valid" + $failedFeatures += ",$feature" + if ($failedFeatures.length -gt 0) { + $output = $failedFeatures.substring(1) + } + $DeploymentScriptOutputs["failedFeaturesRegistrations"] = $output } } }