@@ -133,11 +133,38 @@ function Get-CanaryResult
133133 {
134134 $logContent = Get-Content - Raw - Path $Global :JSONLogFile | ConvertFrom-Json
135135 }
136-
137- Log- Info ($logContent.UseCases | Format-Table - AutoSize @ {Expression = {$_.Name }; Label = " Name" ; Align = " Left" },
138- @ {Expression = {$_.Result }; Label = " Result" ; Align = " Left" },
139- @ {Expression = {((Get-Date $_.EndTime ) - (Get-Date $_.StartTime )).TotalSeconds}; Label = " Duration`n [Seconds]" ; Align = " Left" },
140- @ {Expression = {$_.Description }; Label = " Description" ; Align = " Left" })
136+ $results = @ ()
137+ foreach ($usecase in $logContent.UseCases )
138+ {
139+ $ucObj = New-Object - TypeName PSObject
140+ if ([bool ]($usecase.PSobject.Properties.name -match " UseCase" ))
141+ {
142+ $ucObj | Add-Member - Type NoteProperty - Name Name - Value $usecase.Name
143+ $ucObj | Add-Member - Type NoteProperty - Name Result - Value $usecase.Result
144+ $ucObj | Add-Member - Type NoteProperty - Name " Duration`n [Seconds]" - Value ((Get-Date $usecase.EndTime ) - (Get-Date $usecase.StartTime )).TotalSeconds
145+ $ucObj | Add-Member - Type NoteProperty - Name Description - Value $usecase.Description
146+ $results += $ucObj
147+
148+ foreach ($subusecase in $usecase.UseCase )
149+ {
150+ $ucObj = New-Object - TypeName PSObject
151+ $ucObj | Add-Member - Type NoteProperty - Name Name - Value (" |-- $ ( $subusecase.Name ) " )
152+ $ucObj | Add-Member - Type NoteProperty - Name Result - Value $subusecase.Result
153+ $ucObj | Add-Member - Type NoteProperty - Name " Duration`n [Seconds]" - Value ((Get-Date $subusecase.EndTime ) - (Get-Date $subusecase.StartTime )).TotalSeconds
154+ $ucObj | Add-Member - Type NoteProperty - Name Description - Value (" |-- $ ( $subusecase.Description ) " )
155+ $results += $ucObj
156+ }
157+ }
158+ else
159+ {
160+ $ucObj | Add-Member - Type NoteProperty - Name Name - Value $usecase.Name
161+ $ucObj | Add-Member - Type NoteProperty - Name Result - Value $usecase.Result
162+ $ucObj | Add-Member - Type NoteProperty - Name " Duration`n [Seconds]" - Value ((Get-Date $usecase.EndTime ) - (Get-Date $usecase.StartTime )).TotalSeconds
163+ $ucObj | Add-Member - Type NoteProperty - Name Description - Value $usecase.Description
164+ $results += $ucObj
165+ }
166+ }
167+ Log- Info($results | Format-Table - AutoSize)
141168}
142169
143170function Get-CanaryLonghaulResult
@@ -264,7 +291,7 @@ function Invoke-Usecase
264291 $parentUsecase = $Name
265292 if ((Get-PSCallStack )[1 ].Arguments.Contains($parentUsecase ))
266293 {
267- " `t " * ([math ]::Floor((Get-PSCallStack ).Count/ 3 )) + " |--" + $Name
294+ " `t " * ([math ]::Floor((Get-PSCallStack ).Count/ 3 )) + " |-- " + $Name
268295 }
269296 else
270297 {
0 commit comments