Invoke-Command in a background job

前端 未结 4 1348
庸人自扰
庸人自扰 2021-01-20 14:58

I have a powershell 2.0 script which should run a command on several servers and process the output. I want to run the command and the processing for each server in a backgr

4条回答
  •  隐瞒了意图╮
    2021-01-20 15:33

    This will also work, at least in Powershell 5

    invoke-command -asjob -computer $PC -scriptblock { ## do stuff }
    

提交回复
热议问题