Powershell / .Net: Get a reference to an object returned by a method
- by Dan Menes
I am teaching myself PowerShell by writing a simple parser. I use the .Net framework class Collections.Stack. I want to modify the object at the top of the stack in place.
I know I can pop() the object off, modify it, and then push() it back on, but that strikes me as inelegant.
First, I tried this:
$stk = new-object Collections.Stack…