Closed zloeber closed 6 years ago
Wow, this is awesome! Has this always been possible, or does is require a recent version of PS? I'm just trying to figure out why I never stumbled upon this way of doing it, back when I first wrote this.
It is something capable with newer versions I believe. I actually found the original code source pulled from that you used to wrap around out-default (or modify really). I think it was written in v1 code which was far more persnickity. I just recently ran into another way of accomplishing this that isn't greatly publicized here. I wish I would have found this earlier on as it actually dynamically creates modules with psxml type definitions to accomplish much the same thing without any out-default proxy craziness. In any case, I rewrote much of your code into a plugin within my ohmypsh project and linked back to your project. Hope you don't mind.
This is specifically for Out-Default which never gets reverted back to the original cmdlet when the module unloads otherwise. This update should rectify the reported issue of PowerShell puking when the module is unloaded.