Hi Rob,
I'm performing some tests with oddjob and I'm getting some unexpected behavior executing powershell scripts with an oddjob exec; basically the execution never ends.
I have tried several workarounds like call the execution using a bat file, using parameters like in the execute batch file example etc, but even the strout appears in the console and the powershell finish properly , it still appearing as running in the console until I stop it manually and the rest of the jobs are not executed.
Many thanks in advance for your help.
Hi Rob,
I'm performing some tests with oddjob and I'm getting some unexpected behavior executing powershell scripts with an oddjob exec; basically the execution never ends.
I have tried several workarounds like call the execution using a bat file, using parameters like in the execute batch file example etc, but even the strout appears in the console and the powershell finish properly , it still appearing as running in the console until I stop it manually and the rest of the jobs are not executed.
Many thanks in advance for your help.
oddjob xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<oddjob>
<job>
<exec><![CDATA]></exec>
</job>
</oddjob>
Powershell sample
# Filename: Helloworld.ps1
Write-Host
Write-Host 'Hello World!'
Write-Host "Good-bye World! `n"
# end of script
Hi - A quick Google for 'powershell java exec' and it appears that running powershell from Java is problematic.
However providing an empty stdin does appear to stop powershell from hanging.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<oddjob>
<job>
<exec>
<stdin>
<buffer/>
</stdin><![CDATA]></exec>
</job>
</oddjob>
Hope this helps,
Rob.