Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在powershell中,是否有区别:
ps theProcessName* | kill
和
kill -processname theProcessName*
谢谢
在第一个示例中,您使用 PowerShell 管道将System.Diagnostics.Process对象(从Get-Process)通过管道传输到Stop-Processcmdlet。
System.Diagnostics.Process
Get-Process
Stop-Process
在第二个示例中,您直接调用Stop-Processcmdlet,并使用命名参数传入字符串以匹配进程名称。