Created
October 24, 2020 13:24
-
-
Save ryan-leap/4a0ecedce7535ed47247c73dd0bd41be to your computer and use it in GitHub Desktop.
Shows info about the current process, and it's parent, and it's parent...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$processId = $PID | |
do { | |
$thisProcess = Get-CimInstance -ClassName Win32_Process -Filter "ProcessId = $processId" | |
$thisProcess | Select-Object ProcessId,ParentProcessId,Name,CreationClassName,CreationDate,CommandLine | |
$processId = $thisProcess.ParentProcessId | |
} while ($null -ne $processId) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment