Returning IDisposable objects

Topics: Developer Forum
Mar 15, 2008 at 8:21 PM

This isn't a PSCX specific question, but is related to best practices for writing cmdlets.

What is the best approach when working with IDisposable objects? If these are placed in the pipeline - is there a way to ensure they are disposed of correctly? I'm thinking of the case where powershell users probably aren't .net developers. Where possible, I've avoided placing IDisposables in the pipleline, but there are times when it really does seem necessary.

Mar 16, 2008 at 2:10 AM
Yup, a good point. And one I posted to connect on about a year ago:

please vote on it.

- Oisin