From 26d9582c04caead48f0af037c939ff8a0c82c0d9 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 14 Feb 2025 15:23:41 -0500 Subject: [PATCH 1/2] fix scheduled command --- .../Activity Triggers/Push-ExecScheduledCommand.ps1 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-ExecScheduledCommand.ps1 b/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-ExecScheduledCommand.ps1 index 015589f57b06..4317db419974 100644 --- a/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-ExecScheduledCommand.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-ExecScheduledCommand.ps1 @@ -26,14 +26,15 @@ function Push-ExecScheduledCommand { } try { - $ParamsToRemove = [System.Collections.Generic.List[string]]::new() - foreach ($Parameter in $commandParameters.GetEnumerator()) { - if (!$Function.Parameters.ContainsKey($Parameter.Key)) { - $ParamsToRemove.Add($Parameter.Key) + $PossibleParams = $Function.Parameters.Keys + $keysToRemove = [System.Collections.Generic.List[string]]@() + foreach ($key in $commandParameters.Keys) { + if (-not ($PossibleParams -contains $key)) { + $keysToRemove.Add($key) } } - foreach ($Param in $ParamsToRemove) { - $commandParameters.Remove($Param) + foreach ($key in $keysToRemove) { + $commandParameters.Remove($key) } } catch { Write-Host "Failed to remove parameters: $($_.Exception.Message)" From d078e22659ea6b13caa535c64aad54972185383c Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 14 Feb 2025 17:05:46 -0500 Subject: [PATCH 2/2] Update version_latest.txt --- version_latest.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version_latest.txt b/version_latest.txt index 77f5bec5b2b4..429dc57af3a3 100644 --- a/version_latest.txt +++ b/version_latest.txt @@ -1 +1 @@ -7.2.2 +7.2.3