1+ $Global :ContinueOnFailure = $false
12$Global :JSONLogFile = " Run-Canary.JSON"
23$Global :TxtLogFile = " AzureStackCanaryLog.Log"
34$UseCase = @ {}
@@ -107,7 +108,9 @@ function Start-Scenario
107108 [string ]$Type ,
108109 [parameter (Mandatory = $false )]
109110 [ValidateNotNullOrEmpty ()]
110- [string ]$LogFilename
111+ [string ]$LogFilename ,
112+ [parameter (Mandatory = $false )]
113+ [bool ] $ContinueOnFailure = $false
111114 )
112115
113116 if ($LogFileName )
@@ -130,6 +133,7 @@ function Start-Scenario
130133 " UseCases" = @ ()
131134 }
132135 $jsonReport | ConvertTo-Json - Depth 10 | Out-File - FilePath $Global :JSONLogFile
136+ $Global :ContinueOnFailure = $ContinueOnFailure
133137}
134138
135139function End-Scenario
@@ -171,7 +175,10 @@ function Invoke-Usecase
171175 {
172176 Log- Exception ($_.Exception )
173177 Log- Error (" ###### [END] Usecase: $Name ###### [RESULT = FAIL] ######`n " )
174- throw $_.Exception
178+ if (-not $Global :ContinueOnFailure )
179+ {
180+ throw $_.Exception
181+ }
175182 }
176183}
177184
@@ -454,20 +461,6 @@ function NewAzureStackDefaultQuotas
454461 $serviceQuotas
455462}
456463
457- function RegisterResourceProviders
458- {
459- Get-AzureRmResourceProvider - ListAvailable | Register-AzureRmResourceProvider - Force
460- $requiredRPs = (" Microsoft.Storage" , " Microsoft.Compute" , " Microsoft.Network" , " Microsoft.KeyVault" )
461- foreach ($rp in $requiredRPs )
462- {
463- while ((Get-AzureRmResourceProvider | Where-Object ProviderNamespace -eq $rp ).RegistrationState -ne " Registered" )
464- {
465- Start-Sleep - Seconds 10
466- }
467- }
468- Get-AzureRmResourceProvider | Format-Table
469- }
470-
471464function NewAzureStackDSCScriptResource
472465{
473466 [CmdletBinding ()]
0 commit comments