c# で (PowerShell の) Stop-Process コマンドを使用したい。"Get-Process" コマンドの使い方は知っていますが、stop-process の場合は引数 (プロセス名) を指定する必要があります。私の場合、テキストボックスでユーザーから引数を取得しています。
private void button2_Click(object sender, EventArgs e)
{
PowerShell ps = PowerShell.Create();
ps.AddCommand("Stop-Process -Name " + (textBox1.Text).ToString());
ps.Invoke();
}