Execute a PowerShell script via Script Console remotely

Hi there,

I have a powershell script called “cleanupFiles.ps1” and i need to run this on multiple Octopus environments using script console. is there any way we can run a Power Shell script via script console remotely ?

I prefer to use PowerShell to call/invoke Octopus Script Console to execute another powershell script.

Thank you in advance.

Thanks,
Kishore

Hi Kishore,

Thanks for getting in touch! While it’s possible to run an adhoc script using the console via the API, I don’t think it would be the most straight forward way, and I may suggest an easier approach. However, I found a sample script using the Octopus.Client (an open source .NET library) which may get you started with this approach.

What would be easiest is to run it via the web portal, or zip up your script file and deploy it to invoke it where you need to run it.

I hope this helps! Let me know how you go or if you have any further questions. :slight_smile:

Kind regards,

Kenny

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.