Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell : Cmdlets throwing a PipelineStoppedException

$
0
0

I have a cmdlet named update-name which throws a ThrowTerminatingError when it encounters an exception. This works fine. But when I do get-name | update-name and if in this case an error occurs, it results in an exception :

System.Management.Automation.PipelineStoppedException: The pipeline has been stopped.
   at System.Management.Automation.CommandProcessor.ProcessRecord()
   at System.Management.Automation.CommandProcessorBase.DoExecute()
   at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
   at System.Management.Automation.MshCommandRuntime.WriteObject(Object sendToPi
peline)
   at System.Management.Automation.Cmdlet.WriteObject(Object sendToPipeline)

Thus the exception is shown on the screen only when the input is given from a pipeline. Otherwise it works fine. I am not able to understand this behaviour. Can somebody help?


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>