How does threading in powershell work?

前端 未结 6 1464
有刺的猬
有刺的猬 2020-12-23 23:14

I want to parallelize some file-parsing actions with network activity in powershell. Quick google for it, start-thread looked like a solution, but:

T

6条回答
  •  忘掉有多难
    2020-12-23 23:27

    The answer, now, is quite simple.

    Install-Module -Name ThreadJob -Confirm:$true
    
    $j1= Start-ThreadJob  `
                    -FilePath $YourThreadJob `
                    -ArgumentList @("A","B")
    $j1|get-job
    $j1|receive-job
    

提交回复
热议问题