Is there anyway of using ps to get the pid of a powershell command which is already executing.
For e.g., say I've already executed the following command.
ls | ? { <where condition> } | % { <some operations> }
The goal is I open up another powershell window and type in something that allows me to wait for the above to complete.
Any ideas?