How can I run a build pipeline task to start a process (in this case the Java process with Selenium grid) and continue the build pipeline? I tried a number of different techniques with PowerShell (start-process, start-job) and command line but the build definition did not proceed.
Asked
Active
Viewed 610 times
1 Answers
0
I try to reproduce your issue. I build to powershell scripts in the same directory. Scrip1.ps1
and Scrip2.ps1
.
Scrip1.ps1
Write-Host "Run Script2" -ForegroundColor Yellow
"TestFile" | Out-File "temp.txt"
Start-Process powershell ".\Script2.ps1" -WindowStyle Hidden
Write-Host "Run Script1 finished" -ForegroundColor Green
Scrip2.ps1
Write-Host "Run Script2" -ForegroundColor Yellow
Start-Sleep -s 10
Remove-Item -Path "temp.txt" -Force
Write-Host "Run Script2 finished"
you will see that Script1.ps1
finished long before temp.txt
get deleted.
Related to your Buildpipeline:
Script1.ps1
is your Task inside the buildpipeline (inlnie or as file)
Script2.ps1
is your background process or the caller of the process your want to start (start your java process here)
Hope this solve the problem.