Skip to content

Commit

Permalink
Update Start-CIPPProcessorQueue.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Oct 9, 2024
1 parent 66d1a69 commit 0b25589
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ function Start-CIPPProcessorQueue {
$Parameters = @{}
}
if (Get-Command -Name $QueueItem.FunctionName -Module CIPPCore -ErrorAction SilentlyContinue) {
& $QueueItem.FunctionName @Parameters
try {
Invoke-Command -ScriptBlock { & $QueueItem.FunctionName @Parameters }
} catch {
Write-Warning "Failed to run function $($QueueItem.FunctionName). Error: $($_.Exception.Message)"
}
} else {
Write-Warning "Function $($QueueItem.FunctionName) not found"
}
Expand Down

0 comments on commit 0b25589

Please sign in to comment.