Skip to content

Commit a0dc873

Browse files
authored
Further refine progress and output handling
1 parent d2102df commit a0dc873

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

EntraID/ConditionalAccess/Export-CAPolicies.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ if (-not $IncludeEmptyColumns) {
239239
$ProcessedCount = 0
240240
$OutputCount = 0
241241
#Get all service principals
242-
Write-Host "[+] Retrieving service principals..."
242+
Write-Progress -Activity "Initializing" -Status "Retrieving service principals..." -PercentComplete 10
243243
$ServicePrincipalsHash = Get-MgBetaServicePrincipal -All | Group-Object -Property AppId -AsHashTable
244-
Write-Host "[+] Retrieving named locations..."
244+
Write-Progress -Activity "Initializing" -Status "Retrieving named locations..." -PercentComplete 20
245245
$NamedLocationHash = Get-MgBetaIdentityConditionalAccessNamedLocation -All | Group-Object -Property Id -AsHashTable
246-
Write-Host "Exporting CA policies report..." -ForegroundColor Cyan
246+
Write-Progress -Activity "Exporting" -Status "Retrieving CA policies..." -PercentComplete 30
247247

248248

249249
#Processing all CA policies
@@ -468,9 +468,9 @@ if ($Results.Count -eq 0) {
468468
} else {
469469
$Results | Export-Csv -Path $ExportCSV -NoTypeInformation
470470
}
471-
Write-Host "`nThe output file contains $($Results.Count) CA policies."
471+
Write-Host "The output file contains $($Results.Count) CA policies."
472472
if ((Test-Path -Path $ExportCSV) -eq $true) {
473-
Write-Host "`nThe Output file available at: " -NoNewline -ForegroundColor Yellow
473+
Write-Host "The output file is available at: " -ForegroundColor Yellow
474474
Write-Host $ExportCSV
475475
}
476476
}

0 commit comments

Comments
 (0)