Returning IDisposable objects

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

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.

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

https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=266409&SiteID=99

please vote on it.

- Oisin