How to check for exception further down a pipeline
Posted
by laertejuniordba
on Stack Overflow
See other posts from Stack Overflow
or by laertejuniordba
Published on 2010-05-26T17:32:03Z
Indexed on
2010/05/26
18:01 UTC
Read the original article
Hit count: 221
powershell-v2.0
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 !!!
© Stack Overflow or respective owner