Created
May 19, 2017 21:39
-
-
Save EntranceJew/9a23161ee9aa3568b70912426386d755 to your computer and use it in GitHub Desktop.
figure out what is running that once wasn't
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
function Delta-Process { | |
Param( | |
[Parameter(ValueFromPipeline = $true)] | |
[System.Diagnostics.Process[]] | |
$BaseProcesses | |
) | |
$PostProcesses = Get-Process | |
$NewProcesses = @() | |
$PostProcesses | ForEach-Object { | |
$PostProcess = $_ | |
$PossiblyNew = $true | |
$BaseProcesses | ForEach-Object { | |
if( ($PostProcess.Id -eq $_.Id) -and ($PostProcess.Name -eq $_.Name) ){ | |
$PossiblyNew = $false | |
} | |
} | |
if( $PossiblyNew ){ | |
$NewProcesses += $PostProcess | |
} | |
} | |
return $NewProcesses | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment