"Fossies" - the Fresh Open Source Software Archive

Member "PowerShell-7.2.6/src/powershell/README.md" (11 Aug 2022, 1073 Bytes) of package /linux/misc/PowerShell-7.2.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

PowerShell

The powershell[.exe] executable for PowerShell is built by powershell-unix and powershell-windows projects, as they are the top dependencies of the graph, and has emitEntryPoint: true, meaning a native executable is produced automatically by CLI (no need to own a separate native host).

This project is a very simple shim that provides a Main function for .NET CLI to produce an app. It initializes PowerShell's custom AssemblyLoadContext and then delegates to the same Start function in Microsoft.PowerShell.ConsoleHost that the original native PowerShell host executes; thus we share the same entry point and the same PowerShell host, but use a different native host. This lets us take full advantage of .NET CLI's native host.

We use this shim so that the ConsoleHost project and the original native host do not have to be changed. Additionally, until .NET CLI bugs surrounding content file deployment are solved, this shim allows us to continue with our split Modules folders work-around to deploy the correct versions.