如何使用 Select-object 在单个查询中获取进程和线程的详细信息? [英] How to use Select-object to get details of process and thread in single query?

查看:80
本文介绍了如何使用 Select-object 在单个查询中获取进程和线程的详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行以下查询时,我没有得到进程的名称,只得到了线程的详细信息.

when i executed the following query i am not getting the Name of the process only getting the thread details.

Get-Process -ProcessName Test | Select-Object @{Label='CMPNAME';Expression={$_.Name}}  -ExpandProperty Threads | Select-Object {$_.Id}

        OUTPUT :
                $_.Id
                -----
                8412
                10460
                10484
                10508
                10520
                10524

推荐答案

你需要告诉Select-Object选择哪些属性:

You need to tell Select-Object which properties to select:

Get-Process -ProcessName Test | Select-Object @{Label='CMPNAME';Expression={$_.Name}}  -ExpandProperty Threads | Select-Object CMPNAME,Id

这篇关于如何使用 Select-object 在单个查询中获取进程和线程的详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆