@@ -183,12 +183,12 @@ function Invoke-LiveTestCommand {
183
183
184
184
do {
185
185
try {
186
- Write-Host " ##[section]Start to execute the command `" $Command `" ." - ForegroundColor Green
186
+ Write-Host " ##[section]Start executing the command `" $Command `" ." - ForegroundColor Green
187
187
Write-Host " ##[command]The command `" $Command `" is running." - ForegroundColor Cyan
188
188
189
189
$cmdResult = Invoke-Expression - Command $Command - ErrorAction Stop
190
190
191
- Write-Host " ##[section]Successfully executed the command `" $Command `" " - ForegroundColor Green
191
+ Write-Host " ##[section]Finish executing the command `" $Command `" " - ForegroundColor Green
192
192
193
193
$cmdResult
194
194
break
@@ -243,7 +243,7 @@ function Invoke-LiveTestScenario {
243
243
throw " Error occurred when initializing live tests. The csv file was not found."
244
244
}
245
245
246
- Write-Host " ##[group]Start to execute the live scenario `" $Name `" ." - ForegroundColor Green
246
+ Write-Host " ##[group]Start executing the live scenario `" $Name `" ." - ForegroundColor Green
247
247
248
248
try {
249
249
$snrCsvData = [PSCustomObject ]@ {
@@ -267,13 +267,13 @@ function Invoke-LiveTestScenario {
267
267
$snrResourceGroupLocation = $ResourceGroupLocation
268
268
}
269
269
270
- Write-Host " ##[section]Start to create a resource group." - ForegroundColor Green
270
+ Write-Host " ##[section]Start creating a resource group." - ForegroundColor Green
271
271
Write-Host " ##[section]Resource group name: $snrResourceGroupName " - ForegroundColor Green
272
272
Write-Host " ##[section]Resource group location: $snrResourceGroupLocation " - ForegroundColor Green
273
273
274
274
$snrResourceGroup = New-LiveTestResourceGroup - Name $snrResourceGroupName - Location $snrResourceGroupLocation
275
275
276
- Write-Host " ##[section]Successfully created the resource group." - ForegroundColor Green
276
+ Write-Host " ##[section]Finish creating the resource group." - ForegroundColor Green
277
277
}
278
278
279
279
$snrRetryCount = 0
@@ -288,12 +288,8 @@ function Invoke-LiveTestScenario {
288
288
289
289
$ScenarioScript.InvokeWithContext ($null , $prefs , $snrResourceGroup )
290
290
291
- if ($LASTEXITCODE -eq 0 ) {
292
- Write-Host " ##[section]Successfully executed the live scenario `" $Name `" ." - ForegroundColor Green
293
- }
294
- else {
295
- throw " Error occurred when executing the live scenario `" $Name `" ."
296
- }
291
+ Write-Host " ##[section]Finish executing the live scenario `" $Name `" ." - ForegroundColor Green
292
+
297
293
break
298
294
}
299
295
catch {
@@ -303,18 +299,6 @@ function Invoke-LiveTestScenario {
303
299
304
300
$snrInvocationInfo = $snrErrorRecord.InvocationInfo
305
301
306
- Write-Host " ##[error]Error Object:" - ForegroundColor Red
307
- $_ | Format-List * - Force
308
-
309
- Write-Host " ##[error]Exception Object:" - ForegroundColor Red
310
- $_.Exception.InnerException | Format-List * - Force
311
-
312
- Write-Host " ##[error]Error Record:" - ForegroundColor Red
313
- $snrErrorRecord | Format-List * - Force
314
-
315
- Write-Host " ##[error]Invocation Info:" - ForegroundColor Red
316
- $snrInvocationInfo | Format-List * - Force
317
-
318
302
if ($null -ne $snrInvocationInfo ) {
319
303
$snrScriptName = Split-Path - Path $snrInvocationInfo.ScriptName - Leaf - ErrorAction SilentlyContinue
320
304
if ($snrScriptName -eq " Assert.ps1" ) {
@@ -362,7 +346,7 @@ function Invoke-LiveTestScenario {
362
346
363
347
if (! $NoResourceGroup.IsPresent -and $null -ne $snrResourceGroup ) {
364
348
try {
365
- Write-Host " ##[section]Start to clean up the resource group `" $snrResourceGroupName `" ." - ForegroundColor Green
349
+ Write-Host " ##[section]Start cleaning up the resource group `" $snrResourceGroupName `" ." - ForegroundColor Green
366
350
Clear-LiveTestResources - Name $snrResourceGroupName
367
351
}
368
352
catch {
0 commit comments