Skip to content

Commit d231b21

Browse files
authored
Implement sorting alphabetically by displayname
1 parent b2529a5 commit d231b21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

EntraID/ConditionalAccess/Export-EntraCAPoliciesReport.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ if (-not $IncludeEmptyColumns) {
226226
}
227227
}
228228

229-
$Results | Select-Object -Property ($orderedHeaders | Where-Object { $nonEmptyProps -contains $_ }) | Export-Csv -Path $ExportCSV -NoTypeInformation
229+
$Results | Sort-Object 'DisplayName' | Select-Object -Property ($orderedHeaders | Where-Object { $nonEmptyProps -contains $_ }) | Export-Csv -Path $ExportCSV -NoTypeInformation
230230
} else {
231231
$orderedHeaders = @(
232232
'DisplayName', 'Description', 'Creation Time', 'Modified Time', 'State',
@@ -468,7 +468,7 @@ if ($Results.Count -eq 0) {
468468
$nonEmptyProps += $prop
469469
}
470470
}
471-
$Results | Select-Object -Property ($orderedHeaders | Where-Object { $nonEmptyProps -contains $_ }) | Export-Csv -Path $ExportCSV -NoTypeInformation
471+
$Results | Sort-Object 'DisplayName' | Select-Object -Property ($orderedHeaders | Where-Object { $nonEmptyProps -contains $_ }) | Export-Csv -Path $ExportCSV -NoTypeInformation
472472
} else {
473473
$Results | Export-Csv -Path $ExportCSV -NoTypeInformation
474474
}

0 commit comments

Comments
 (0)