Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 如何使用Select对象在单个查询中获取进程和线程的详细信息?_Powershell_Thread Safety_Threadpool - Fatal编程技术网

Powershell 如何使用Select对象在单个查询中获取进程和线程的详细信息?

Powershell 如何使用Select对象在单个查询中获取进程和线程的详细信息?,powershell,thread-safety,threadpool,Powershell,Thread Safety,Threadpool,当我执行以下查询时,我没有得到进程的名称,只得到线程的详细信息 Get-Process -ProcessName Test | Select-Object @{Label='CMPNAME';Expression={$_.Name}} -ExpandProperty Threads | Select-Object {$_.Id} OUTPUT : $_.Id ----- 8412

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

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

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

您需要告诉
选择对象
要选择哪些属性:

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

您需要告诉
选择对象
要选择哪些属性:

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

多谢各位@谢谢你@马蒂亚斯