我有一个有效的脚本。它使用以下代码通过websocket预热我们的Web服务器。问题在于它只是顺序的。如何做到这4个进程同时运行?
$configurations = @'
warmupHost,SERVERID
host.domain.com,p1
host.domain.com,p2
host.domain.com,p1
host2.domain.com,p2
'@ | ConvertFrom-Csv
$configurations | % {
$socatProcess = Start-Process -FilePath .\websocat_win64.exe -Args "`"wss://${warmupHost}/atmosphere/warmupSessionId?url=https%253A%252F%252F${warmupHost}%252Fnosso&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.3.3-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-atmo-protocol=true`" -n -H `"Cookie:SERVERID=${serverID}`"" -RSI .\login.json -PassThru
echo $socatProcess
Start-Sleep -s 5
Stop-Process $socatProcess
}