clean up exchangePurge output (#3009)

Get contact counts isn't working. Just comments out the create for now.

---

#### Type of change

- [x] 🐛 Bugfix

#### Test Plan

- [x] 💪 Manual
This commit is contained in:
Keepers 2023-04-03 18:23:29 -06:00 committed by GitHub
parent 99774e754b
commit 9eb070c0bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,7 +239,7 @@ function Get-FoldersToPurge {
} }
if ((IsNameMatch @IsNameMatchParams) -or (IsPrefixAndAgeMatch @IsPrefixAndAgeMatchParams)) { if ((IsNameMatch @IsNameMatchParams) -or (IsPrefixAndAgeMatch @IsPrefixAndAgeMatchParams)) {
Write-Host "`nFound desired folder to purge: $folderName ($folderCreateTime)" Write-Host "Found: $folderName ($folderCreateTime)"
$foldersToDelete += $folder $foldersToDelete += $folder
} }
} }
@ -273,7 +273,13 @@ function Empty-Folder {
} }
if ($PSCmdlet.ShouldProcess("Emptying $foldersToEmptyCount folders ($WellKnownRootList $FolderNameList)", "$foldersToEmptyCount folders ($WellKnownRootList $FolderNameList)", "Empty folders")) { if ($PSCmdlet.ShouldProcess("Emptying $foldersToEmptyCount folders ($WellKnownRootList $FolderNameList)", "$foldersToEmptyCount folders ($WellKnownRootList $FolderNameList)", "Empty folders")) {
Write-Host "`nEmptying $foldersToEmptyCount folders ($WellKnownRootList $FolderNameList)" Write-Host "`nEmptying $foldersToEmptyCount folders..."
foreach ($folder in $FolderNameList) {
Write-Host "$folder"
}
foreach ($folder in $WellKnownRootList) {
Write-Host "$folder"
}
# DeleteType = HardDelete, MoveToDeletedItems, or SoftDelete # DeleteType = HardDelete, MoveToDeletedItems, or SoftDelete
$body = @" $body = @"
@ -308,6 +314,9 @@ function Delete-Folder {
if ($PSCmdlet.ShouldProcess("Removing $foldersToRemoveCount folders ($FolderNameList)", "$foldersToRemoveCount folders ($FolderNameList)", "Delete folders")) { if ($PSCmdlet.ShouldProcess("Removing $foldersToRemoveCount folders ($FolderNameList)", "$foldersToRemoveCount folders ($FolderNameList)", "Delete folders")) {
Write-Host "`nRemoving $foldersToRemoveCount folders ($FolderNameList)" Write-Host "`nRemoving $foldersToRemoveCount folders ($FolderNameList)"
foreach ($folder in $FolderNameList) {
Write-Host "$folder"
}
# DeleteType = HardDelete, MoveToDeletedItems, or SoftDelete # DeleteType = HardDelete, MoveToDeletedItems, or SoftDelete
$body = @" $body = @"
@ -353,7 +362,10 @@ function Purge-Folders {
} }
if ($FolderPrefixPurgeList.count -gt 0 -and $PurgeBeforeTimestamp -ne $null) { if ($FolderPrefixPurgeList.count -gt 0 -and $PurgeBeforeTimestamp -ne $null) {
Write-Host "Folders older than $PurgeBeforeTimestamp with prefix: $FolderPrefixPurgeList" Write-Host "Folders older than $PurgeBeforeTimestamp with prefix:"
foreach ($folder in $FolderPrefixPurgeList) {
Write-Host "$folder"
}
} }
$foldersToDeleteParams = @{ $foldersToDeleteParams = @{
@ -492,7 +504,7 @@ function Purge-Contacts {
Write-Host "`nCleaning up contacts older than $PurgeBeforeTimestamp" Write-Host "`nCleaning up contacts older than $PurgeBeforeTimestamp"
Write-Host "-------------------------------------------------------" Write-Host "-------------------------------------------------------"
# Create one seed contact which will have recent create date and will not be sweapt # Create one seed contact which will have recent create date and will not be swept
# This is needed since tests rely on some contact data being present # This is needed since tests rely on some contact data being present
Write-Host "`nCreating seed contact" Write-Host "`nCreating seed contact"
Create-Contact Create-Contact