Azure DevOps pipeline: remote powershell task seems never finish

Copper Contributor

I try the "run powershell on remote machines" task to restart my Tomcat (java) service on the Windows server.
It just keep printing useless info in the console

Han_Shih_0-1651225091549.png

 

 

Here is the detail about the powershell script:
1. stop Tomcat service (call a .bat file)
2. move .jar files to right location & replace old files
3. start Tomcat service (call a .bat file)

 

& D:\MY\PATH\stop.bat;

......
Copy-Item -Path "D:/s-1.0.jar" -Destination $sqs_path -Force;
......

& D:\MY\PATH\start.bat;

 


When I run the same command directly in that windows server, the "powershell part" trigger .bat script job, then get back to powershell console successfully .
Later, a new window pops out. The new window is Tomcat server that shows logs of my service.

 

However, when I do the same job with Azure release pipeline, the Tomcat window did not show up.
And release job console keep hanging.
I think somewhat the output of popout window has be redirected to the console in release pipeline.

 

In addition, if I cancel the release job. my Tomcat service still working. (just without console to debug)

 

Or, another thought, can I achieve my goal with other task? (powershell is not a "must")

 


Any suggestion would be appreciated.

 

 

1 Reply

@Han_Shih did you find a solution to this? We are having the same problem - a pipeline never finishing a powershell script. If we log into the build server and run the scripts manually it runs just fine.