I've been reading through the PSReflect code, and I want to take a shot at creating my own interpretation of it. It may or may not have any value to others.
But I'm wondering if I should work in parallel in forks of both PSReflect and PSReflect-Functions, just to keep things in sync. (In case my project bears any fruit)
Actually, I just noticed that in @mattifestation's copy, it has the update that I found necessary to get it to run under PowerShell 7. (Because they moved the .DefineDynamicAssembly() method)
https://github.com/mattifestation/PSReflect/blob/e8a4e831d1c58b2dd38662153909f9a8b135badc/PSReflect.psm1#L51
And I think that .DefineDynamicModule( [string], [bool] ) is going away in .NET 5. .DefineDynamicModule( [string] ) will be it; there will be no other overloads as far as I can tell.
My use case is to do P/Invoke stuff involving user32.dll , which is outside the scope of what is going on here. Of course, what I'm doing could just as easily be done with C# code in a string, passed to Add-Type. But that's not as much fun.
One last question: How important is PowerShell version 2 compatibility for code like this, moving forward?