How to check for exception further down a pipeline
- by laertejuniordba
Hi all
I am using New-Object System.Management.Automation.PipelineStoppedException
To stop the pipeline OK..works..
But how Can I test in the next cmdlet if was stopped ?
Foo1 | foo2 | foo3
Stop in foo1, but goes to foo2. I want to test if was stopped in foo1 to stop too in each function
function foo1 {
process {
try {
#do
} catch {
New-Object System.Management.Automation.PipelineStoppedException
}
}
}
and still going to the next cmdlet, as stopped by error I want to stop in each next cmdlets..:)
Thanks !!!