I have an Azure Powershell Runbook which is used to invoke a java jar inside the Hybrid Worker Groups.
Currently we pass the absolute java path and run the program, Iwant to change this and pass JAVA_HOME instead. I have set java home as environment variable and is able to access inside the hybrid worker.
$java = $Env:JAVA_HOME
Write-Output "$java"
this give the right path when ran inside the hybrid.
When passing this value via runbook it is not returning any value. The Write-Output returns empty when running via Automation Runbooks
$java = $Env:JAVA_HOME
Write-Output "$Env:JAVA_HOME"
$arguments = "-cp C:\\prgm\jws\jar\jwsClient-0.0.1.jar"
$p = Start-Process -FilePath $java -ArgumentList $arguments
Any help is appreciated.