Skip to content

Instantly share code, notes, and snippets.

@JohnL4
Last active November 3, 2023 13:50
Show Gist options
  • Save JohnL4/f7b199f67f7d3433ce12ff545f48672d to your computer and use it in GitHub Desktop.
Save JohnL4/f7b199f67f7d3433ce12ff545f48672d to your computer and use it in GitHub Desktop.
Get processes WITH COMMAND LINES (must run as admin)
get-process node `
| select id,starttime,name,
@{ Name="CommandLine";
Expr={ $filter = "ProcessId = {0}" -f $_.Id; (Get-CimInstance Win32_Process -filter $filter).CommandLine }} `
| ? {$_.CommandLine -match ' gulp\.js Build_'} `
| sort starttime `
| ft -au -wr
# Omit the filter on gulp.js for a fuller result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment