File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,12 +63,14 @@ if ($LASTEXITCODE -gt 0) {
6363}
6464
6565$OutPathPrefix = " $ ( $Env: REPORT_OUTPUT ) /$ ( Get-Date - Format " yyyy/MM/dd" ) /"
66+ $TenantCount = 0
6667$Files = @ ()
67- $Errors = @ ()
68+ $ErrorTenants = @ ()
6869
6970Foreach ($tenantConfig in $ (Get-ChildItem ' input\' )) {
7071 try {
7172 $Organization = $tenantConfig.BaseName.split (" _" )[0 ]
73+ $TenantCount += 1
7274 Write-Output " Running ScubaGear for $ ( $tenantConfig.BaseName ) "
7375
7476 $Params = @ {
@@ -109,7 +111,7 @@ Foreach ($tenantConfig in $(Get-ChildItem 'input\')) {
109111 Remove-Item $ResultsFile
110112
111113 } catch {
112- $Errors += $Organization
114+ $ErrorTenants += $Organization
113115 Write-Output " Error occurred while running on $ ( $Organization ) "
114116 Write-Output $_
115117 }
@@ -132,9 +134,9 @@ if ("true" -ne $Env:SKIP_AUDIT_LOG) {
132134 Write-Output " Uploaded audit log to $OutPathPrefix$AuditFile "
133135}
134136
135- Write-Output " Finished running on $ ( $Files .Count ) tenants. Encountered $ ( $Errors .Count ) Errors "
136- if ($Errors .Count -gt 0 ) {
137- Write-Output " Tenants with errors:`n $ ( $Errors -join " `n " ) "
137+ Write-Output " Finished running on $TenantsCount tenants. Encountered $ ( $ErrorTenants .Count ) ErrorTenants "
138+ if ($ErrorTenants .Count -gt 0 ) {
139+ Write-Output " Tenants with errors:`n $ ( $ErrorTenants -join " `n " ) "
138140 exit 1
139141}
140142exit 0
You can’t perform that action at this time.
0 commit comments