Running powershell/terminal from within Grasshopper


I am developing a plug-in that generates some analysis files for OpenFOAM, which is a CFD software that runs on Linux. At the moment I have a break in my automated work flow since I need to manually transfer the files generated with Grasshopper to my computing cluster. The transfer can be done using a terminal or a powershell and I am therefore looking into possibilities of doing this directly in Grasshopper.

I was thinking that I can write a component that takes in the path to the files that I want to transfer from Windows and a path on my cluster to where I want to transfer the files to and then opens up a shell and perform the required commands.

Does anyone know if this is doable? And if so, any hints on how to do it?

Thankful for help on this one!

Yes it’s doable through C#/Python/VB. I’d recommend to perform the file action in your script, rather than use terminal and call a script. For the latter, you may be looking for Process.Start()

Exactly - My idea is that when a condition is true (eg a Button) my component will automatically call the necessary commands in the background (or shortly open a CMD/Powershell and perform the commands automatic) to transfer the files.

I am not a super advanced coder so I would need some help with Process.Start() as you suggest. How can I use this? Or can you guide me to some documentation?


I’m not sure if this is directly helpful, but it might inform your development: