Skip to content

Commit

Permalink
parameter splat cleanup
Browse files Browse the repository at this point in the history
Remove null/blank/empty values
  • Loading branch information
JohnDuprey committed Feb 25, 2025
1 parent e6b7ee5 commit 41d5c03
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Modules/CIPPCore/Public/Add-CIPPScheduledTask.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ function Add-CIPPScheduledTask {
$Parameters = [System.Collections.Hashtable]@{}
foreach ($Key in $task.Parameters.PSObject.Properties.Name) {
$Param = $task.Parameters.$Key

if ($null -eq $Param -or $Param -eq '' -or ($Param | Measure-Object).Count -eq 0) {
continue
}
if ($Param -is [System.Collections.IDictionary] -or $Param.Key) {
$ht = @{}
foreach ($p in $Param.GetEnumerator()) {
Expand Down

0 comments on commit 41d5c03

Please sign in to comment.