-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
It is unreasonably obscure to get the parent of a process via PowerShell today.
Get-Command -Noun Process will not give you anything, and you have to know that
there is a ParentProcessId on Get-CimInstance win32_process. Even when you know that, you have to understand recycling of process ids and that you have to check the start time of the processes to actually know if it is your parent.
On top of that Get-CimInstance win32_process is dog slow due to some repetitive loading of mui dlls for some time zone related localization.
I suggest an extended property Diagnostics.Process ParentProcess {get;} that does the heavy lifting for the user in a fast and correct manner.
I don't know if it is valuable to also expose the ParentPid. (You were started by a process that had this id at the time when our your process started). Thoughts?