Skip to content

Commit 5f55eaf

Browse files
committed
Update Invoke-ExecListBackup.ps1
1 parent 538b5a3 commit 5f55eaf

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,21 @@ 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', 'OriginalEntityId') -and $_.Value }
25-
[PSCustomObject]@{
26-
TenantFilter = $item.RowKey -match '^(.*?)_' | ForEach-Object { $matches[1] }
27-
BackupName = $item.RowKey
28-
Timestamp = $item.Timestamp
29-
Items = $properties.Name
24+
$properties = $item.PSObject.Properties | Where-Object { $_.Name -notin @('TenantFilter', 'ETag', 'PartitionKey', 'RowKey', 'Timestamp', 'OriginalEntityId', 'SplitOverProps', 'PartIndex') -and $_.Value }
25+
26+
if ($Type -eq 'Scheduled') {
27+
[PSCustomObject]@{
28+
TenantFilter = $item.RowKey -match '^(.*?)_' | ForEach-Object { $matches[1] }
29+
BackupName = $item.RowKey
30+
Timestamp = $item.Timestamp
31+
Items = $properties.Name
32+
}
33+
} else {
34+
[PSCustomObject]@{
35+
BackupName = $item.RowKey
36+
Timestamp = $item.Timestamp
37+
}
38+
3039
}
3140
}
3241
$Result = $Processed | Sort-Object Timestamp -Descending

0 commit comments

Comments
 (0)