Skip to content

Instantly share code, notes, and snippets.

@EntranceJew
Created May 19, 2017 21:39
Show Gist options
  • Save EntranceJew/9a23161ee9aa3568b70912426386d755 to your computer and use it in GitHub Desktop.
Save EntranceJew/9a23161ee9aa3568b70912426386d755 to your computer and use it in GitHub Desktop.
figure out what is running that once wasn't
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