我想知道在PowerShell 7或pwsh(https://github.com/PowerShell/PowerShell#-powershell)中,是否可以像$PID或进程ID一样使用$TID获取线程ID。我可以通过运行foreach-object -parallel命令,在sysinternals procexp(https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer)中查看包含TID列的许多线程,在pwsh.exe属性的线程选项卡中。
1..20 | foreach-object -Parallel { start-sleep (5*$_) } -ThrottleLimit 20