Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to kill process with powershell

5 views
Skip to first unread message

jerry qian

unread,
Jan 5, 2010, 9:09:43 PM1/5/10
to
hello everyone
i am new here and just learned powershell few days .
I want to declare a array that contains my program name,and then I shutdown
it when I run the powershell script.
here is my code


$array=("a","b","c")
foreach($i in $array){get-process|where { _$.Name -Equal $i}|kill}


can you help me to edit it .thanks

Marco Shaw [MVP]

unread,
Jan 5, 2010, 9:45:43 PM1/5/10
to
> $array=("a","b","c")
> foreach($i in $array){get-process|where { _$.Name -Equal $i}|kill}

That last line should be more like:
foreach($i in $array){get-process|where {$_.Name -Eq $i}|kill}

jerry qian

unread,
Jan 7, 2010, 12:36:09 AM1/7/10
to

nobody help me

"jerry qian" <qianx...@csii.com.cn> 写锟斤拷锟斤拷息
news:e$VDnlnjK...@TK2MSFTNGP05.phx.gbl...

0 new messages