Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In powershell, is there a difference between:

ps theProcessName* | kill


kill -processname theProcessName*


share|improve this question
up vote 2 down vote accepted

Effectively, the answer is "no."

ps [processname] | kill will query for a list of objects matching 'processname' and pass those objects to the kill command.

kill -processname [processname] will kill all processes matching 'processname'.

The only difference is how the commands work on the backend. For ps [processname] | kill, Powershell will first perform a Get-Process command, then pass it to kill. kill -processname [processname] will simply issue a Stop-Process command, without querying for their existence first.

Short answer: they will both perform the same task. the straight kill command is very slightly faster, because one step is skipped.

share|improve this answer

Well, "ps processname" doesn't do anything. And "kill -p" doesn't kill. It prints.

share|improve this answer
powershell, not bash; – Hyppy Jun 18 '12 at 13:52
right, I edited my question that it's in powershell – jon Jun 18 '12 at 14:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.