Skip to content

Instantly share code, notes, and snippets.

@chrdek
Created September 13, 2018 16:50
Show Gist options
  • Save chrdek/96abd42bb7b4a3d395b74a1f7260f410 to your computer and use it in GitHub Desktop.
Save chrdek/96abd42bb7b4a3d395b74a1f7260f410 to your computer and use it in GitHub Desktop.
export specific processes to file
$d=(gps chrome*,security*|Select ProcessName,Id -First 1 -Last 1);$c=[String]::Concat($d.ProcessName.SubString(0,1).toLower());$o=$c[1]+$c[0];$v=$d[0].ProcessName+","+$d[0].Id+","+$d[1].ProcessName+","+$d[1].Id;Start-Process powershell.exe -ArgumentList @($o,"-Value $v","-Path .\Out1.txt");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment