File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ function Receive-CippOrchestrationTrigger {
103103 }
104104
105105 if (($Batch | Measure-Object ).Count -gt 0 ) {
106+ Write-Information " Batch Count: $ ( $Batch.Count ) "
106107 $Tasks = foreach ($Item in $Batch ) {
107108 $DurableActivity = @ {
108109 FunctionName = ' CIPPActivityFunction'
@@ -113,7 +114,7 @@ function Receive-CippOrchestrationTrigger {
113114 }
114115 Invoke-DurableActivity @DurableActivity
115116 }
116- if ($NoWait ) {
117+ if ($NoWait -and $Tasks ) {
117118 $null = Wait-ActivityFunction - Task $Tasks
118119 }
119120 }
@@ -152,7 +153,7 @@ function Receive-CippActivityTrigger {
152153 if ($Item.FunctionName ) {
153154 $FunctionName = ' Push-{0}' -f $Item.FunctionName
154155 try {
155- & $FunctionName - Item $Item
156+ Invoke-Command - ScriptBlock { & $FunctionName - Item $Item }
156157
157158 if ($TaskStatus ) {
158159 $QueueTask.Status = ' Completed'
You can’t perform that action at this time.
0 commit comments