Skip to content

Command Stop TaskProcessing

Michael Zanatta edited this page Sep 16, 2026 · 1 revision

Stop-TaskProcessing

Synopsis

Stops the processing of the script when called within the Start-DscRunner function.

Description

The Stop-TaskProcessing function is designed to halt the execution of a script. It ensures that it is only called within the context of the Start-DscRunner function by checking the call stack. If called outside of this context, it will throw an error.

It takes no parameters. It is intended to be called from a resource's postExecutionScript, which requires PipelineRunnerSettings.AllowExecutionScripts to be enabled; the postCondition-only stopProcessing() accessor is the equivalent that needs no opt-in.

Examples

Example 1

postExecutionScript: if ($Project_Ensure -eq 'Absent') { Stop-TaskProcessing }

Skips every remaining resource in the current configuration file when the project is being
torn down, since everything else in the file cascades under it.

Clone this wiki locally