News for hackers. Stuff that matters.
Re:Write a Shell in C (2015) by barrkel on Tuesday December 06, 2016 @08:16AM (#13114329)
I did the same exercise, and I found this immediately (straight drilldown through directories from the top level):

https://github.com/PowerShell/PowerShell/blob/master/src/pow...

It's instantiating the execution engine (.NET-speak for the core runtime) getting ready to run Monad (the original codename for PowerShell).

I think part of it is familiarity and context. I knew none of the command bits would be likely to contain an entrypoint. Directories that mentioned native looked useful for finding an entrypoint, because I know that PowerShell is implemented in C# - I reasoned I'd be able to find further managed entrypoints by looking at where it starts out in C++.

You can see that the main object it instantiates is Microsoft.PowerShell.UnmanagedPSEntry. Looks useful.

A search across the repo for UnmanagedPSEntry lead me to https://github.com/PowerShell/PowerShell/tree/master/src/Mic... which seems to contain all the entrypoints you're looking for.

The main loop is in InputLoop in https://github.com/PowerShell/PowerShell/blob/master/src/Mic...

(FTR, this took me about 8 minutes, including finding links that didn't include hashes.)

There are no comments on this comment yet.