I need some help. I am creating a deployment tool which works in Windows and the goal is to generate deliverables for a variety of platforms. I want to run the powershell script to call the python scripts prepared with Codesys script engine API. I used start-process cmdlet like
I need the return value from this execution to make further decisions down the sequence.
I see nothing when I print the $ImportResult.
The code of Testme.py is:
from future import print_function
import os
import sys
print("Hi Codesys ! I am being tested ")
sys.exit(1)
I guess the python might return 1 but not Codesys.exe ....Here the Codesys window does not close.
I tried with --noUI as well...Here as well I dont read the return value. $Lastexitcode also did not help
I would be glad to see a powershell script reading the exitcode of the python script which does a set of actions in codesys.
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello All
I need some help. I am creating a deployment tool which works in Windows and the goal is to generate deliverables for a variety of platforms. I want to run the powershell script to call the python scripts prepared with Codesys script engine API. I used start-process cmdlet like
$ImportResult = Start-Process -FilePath "path of CoDeSys.exe" -ArgumentList '--Profile="our codesys profile"', '--runscript="Testme.py"'
I need the return value from this execution to make further decisions down the sequence.
I see nothing when I print the $ImportResult.
The code of Testme.py is:
from future import print_function
import os
import sys
print("Hi Codesys ! I am being tested ")
sys.exit(1)
I guess the python might return 1 but not Codesys.exe ....Here the Codesys window does not close.
I tried with --noUI as well...Here as well I dont read the return value. $Lastexitcode also did not help
I would be glad to see a powershell script reading the exitcode of the python script which does a set of actions in codesys.
Thank you