Skip to content

Commit 538b5a3

Browse files
committed
Add TenantFilter extraction to backup list output
Updated Invoke-ExecListBackup to extract and include TenantFilter from RowKey when NameOnly is specified. Also excluded 'OriginalEntityId' from the listed properties.
1 parent 423a605 commit 538b5a3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ExecListBackup.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ function Invoke-ExecListBackup {
2121

2222
if ($NameOnly) {
2323
$Processed = foreach ($item in $Result) {
24-
$properties = $item.PSObject.Properties | Where-Object { $_.Name -notin @('TenantFilter', 'ETag', 'PartitionKey', 'RowKey', 'Timestamp') -and $_.Value }
24+
$properties = $item.PSObject.Properties | Where-Object { $_.Name -notin @('TenantFilter', 'ETag', 'PartitionKey', 'RowKey', 'Timestamp', 'OriginalEntityId') -and $_.Value }
2525
[PSCustomObject]@{
26-
BackupName = $item.RowKey
27-
Timestamp = $item.Timestamp
28-
Items = $properties.Name
26+
TenantFilter = $item.RowKey -match '^(.*?)_' | ForEach-Object { $matches[1] }
27+
BackupName = $item.RowKey
28+
Timestamp = $item.Timestamp
29+
Items = $properties.Name
2930
}
3031
}
3132
$Result = $Processed | Sort-Object Timestamp -Descending

0 commit comments

Comments
 (0)