PowerShell/src/powershell/README.md
Sergei Vorobev 875402ad53 Create separate Top-level directory per platform
- Replace src\powershell top level project by two
  new root-level projects:
    - src\powershell-unix
    - src\powershell-windows
- Break src\Modules into more granular structure:
  - Shared
  - Windows+Unix-Core
  - Windows-Core
  - Windows-Core+Full
  - Windows-Full
  - To be created: Unix-Core. We will do it as a separate PR
- Fix #1122 : Platform-specific set of Modules (and assemblies)
- Fix Start-TypeGen to work with new top level folders layout
2016-07-22 16:11:29 -07:00

1 KiB

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.