Skip to content

Extend System.Diagnostics.Process with a ParentProcess property #2763

@powercode

Description

@powercode

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions