Skip to content

Commit 9f82116

Browse files
authored
Merge pull request KelvinTegelaar#1163 from JohnDuprey/dev
entrypoint tweaks
2 parents 32e515c + 1818a6a commit 9f82116

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Modules/CippEntrypoints/CippEntrypoints.psm1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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'

0 commit comments

Comments
 (0)