title: PowerShell cmdlet development - How to avoid retaining handles to output objects
body: <p>Microsoft's "Required Development Guidelines" for Cmdlet development <a href="http://msdn.microsoft.com/en-us/library/dd878238%28v=vs.85%29.aspx#RC05" rel="nofollow">here</a> states that a Cmdlet should not retain handles to output objects.</p>
  
  <p>However when developing a cmdlet which performs a side effect on pipeline input, which may or may not modify the state of the input object, one can pipe the input object to the output pipeline via WriteObject method to promote further chaining of commands. Since pipeline input parameter is an array of input object type, it will still be retaining a reference to the object.</p>
  
  <p>Will this behavior break the development contract and cause problems?</p>