When we do code in c#, we have using statement to dispose our objects. so we don’t have to. :). What about PowerShell? Can we do that?
Here is a PowerShell function which behaves as using statement. 🙂
So whenever we are dealing with an object that should be disposed we can use this function as below.
Isn’t that cool? 🙂