03-10-2018 10:40 AM
Hi,
Is there any way to execute a command line scripts (Ex: Power shell)?
Our scenario is to execute a set of commands (which is located over in a server, where we could establish a connection through an FTP/SFTP) at the end of load completion for an UI Refresh, please advise if there is any direct way or just let us know any workaround!!
Thanks,
Aravind
03-12-2018 07:09 AM
We have the similar requirement, but what we use is ssh not Power shell. but I would say its the same mechanism.
We use script snap with Python to achieve this and it worked perfectly.
03-12-2018 11:50 AM
Hey @walkerline117,
My work is specific to perform with shell script, I am aware of the script snap! Can you explain on what scenario you used python to replace ssh
03-13-2018 06:21 AM
it doesn’t matter if thats shell or ssh or powershell… they are all command lines.
Also, we are not using python to replace ssh. we are using python to trigger ssh command on groundplex node.
This is part of our code in script snap
def execute(self):
self.log.info(“Executing Transform script”)
proc = Popen([“ssh”, “username@server”, “D://test.bat”], shell=False, stdout=PIPE, stderr=PIPE)
out, err = proc.communicate()
exitcode = proc.returncode
proc.kill()
self.output.write(out)
self.log.info(“Finished executing the Transform script”)
You just need to figure out how to use python to run ssh, or PowerShell or any command line.
Thanks
Han
03-13-2018 09:33 PM
Thanks @walkerline117, will check