Azure DevOps pipeline: remote powershell task seems never finish

Han Shih 施學翰 146 Reputation points
2022-04-29T09:36:29.993+00:00

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
197694-image.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.

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.