Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix set-junk-rules regular and global commands #35717

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixes
  • Loading branch information
YuvHayun committed Aug 1, 2024
commit c18c029212d9a7766c52bebc97878dd1cd6ec5ac
Original file line number Diff line number Diff line change
Expand Up @@ -1765,19 +1765,14 @@ function SetJunkRulesCommand([ExchangeOnlinePowershellV3Client]$client, [hashtab
}

function CreateAddAndRemoveSections([string[]]$items_to_add, [string[]]$items_to_remove ){
YuvHayun marked this conversation as resolved.
Show resolved Hide resolved
if ((-not [string]::IsNullOrEmpty($items_to_add)) -and (-not [string]::IsNullOrEmpty($items_to_remove))){
return @{Add = $items_to_add
Remove = $items_to_remove
}
}
elseif (-not [string]::IsNullOrEmpty($items_to_add)){
return @{Add = $items_to_add
}
$params = @{}
if (-not [string]::IsNullOrEmpty($items_to_add)){
$params["Add"] = $items_to_add
}
elseif (-not [string]::IsNullOrEmpty($items_to_remove)){
return @{Remove = $items_to_remove
}
if (-not [string]::IsNullOrEmpty($items_to_remove)){
$params["Remove"] = $items_to_remove
}
return $params
}

function SetGlobalJunkRulesCommand([ExchangeOnlinePowershellV3Client]$client, [hashtable]$kwargs) {
Expand Down
Loading