You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I just found out about your project and wanted to let you know I've been working on something similar on my side meant to load PowerShell 7 entirely at runtime from its installation path. I finished my initial proof-of-concept code in C, after which I intend to port it to Rust. Your project is definitely much more advanced on the Rust side, but you may be interested in taking some bits and pieces from the dynamic loading technique that eliminates the need for statically linking anything from .NET.
Since PowerShell 7 ships a full copy of .NET 5, my project aims at detecting PowerShell and then loading it. Nothing really prevents loading another .NET 5 runtime from another location, and re-implementing the nethost static library that exports a single function to facilitate detection. My intent is really to make PowerShell (or .NET 5) fully usable as a library without installing additional files.
You will notice the related issues are all about adding a single helper function to make it possible to load an assembly file in memory. Rust makes it quite easy to embed files, but for the C code I wrote a script to generate a static array. PowerShell 7.2-preview6 now includes "LoadAssemblyFromNativeMemory" but this function could be provided by a separate DLL and ported to anything, really, if you can afford to ship an additional DLL with your program.
Let me know if some of the things I've done on my side could interest you for this project. Your Rust code is much more advanced than my current C code I've barely begun porting to Rust. I'll be working on this for the next week or so.
The text was updated successfully, but these errors were encountered:
Hi! I just found out about your project and wanted to let you know I've been working on something similar on my side meant to load PowerShell 7 entirely at runtime from its installation path. I finished my initial proof-of-concept code in C, after which I intend to port it to Rust. Your project is definitely much more advanced on the Rust side, but you may be interested in taking some bits and pieces from the dynamic loading technique that eliminates the need for statically linking anything from .NET.
Here are the relevant issues:
PowerShell/PowerShell#14652
PowerShell/PowerShell#14641
dotnet/runtime#46652
And the reference code I have so far:
https://github.com/awakecoding/pwsh-native-host
https://github.com/awakecoding/pwsh-host-rs
Since PowerShell 7 ships a full copy of .NET 5, my project aims at detecting PowerShell and then loading it. Nothing really prevents loading another .NET 5 runtime from another location, and re-implementing the nethost static library that exports a single function to facilitate detection. My intent is really to make PowerShell (or .NET 5) fully usable as a library without installing additional files.
You will notice the related issues are all about adding a single helper function to make it possible to load an assembly file in memory. Rust makes it quite easy to embed files, but for the C code I wrote a script to generate a static array. PowerShell 7.2-preview6 now includes "LoadAssemblyFromNativeMemory" but this function could be provided by a separate DLL and ported to anything, really, if you can afford to ship an additional DLL with your program.
Let me know if some of the things I've done on my side could interest you for this project. Your Rust code is much more advanced than my current C code I've barely begun porting to Rust. I'll be working on this for the next week or so.
The text was updated successfully, but these errors were encountered: