0

I would like to be able to call Powershell scripts using a REST API. (Please note that I am describing the _opposite_ of calling a REST API from Powershell.) Are there any prebuilt API gateways that support this use case? I've looked at Ocelot, but it currently only acts as a gateway to other REST APIs. Ideally I would simply design my Powershell script functions to follow a defined interface pattern, put the files into a defined directory, and the API gateway would either immediately make those functions available as REST API calls or with minimal configuration.

EDIT: To clarify, I am looking for something self hosted, not cloud based. I haven't found anything yet that is exactly what I need, I may create something myself.

2 Answers 2

1

You can try AWS Lambda and API gateway integration.

Here is an example: https://aws.amazon.com/blogs/developer/creating-a-powershell-rest-api/

Amazon offer 12 month free tier plan for this.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your suggestion. I should have clarified that I was looking for something self hosted, rather than cloud based.
1

A couple of options. If you are on Azure you could expose your Powershell Scripts through Azure Automation :

That'd be a lightweight way of having your scripts enabled through a HTTP POST scenario.

You could also combine or mix it with adding API Management in front to support various scenarios (adding GET/PUT/DELETE support e.g.) or even automate or proxy more things. API Management could of course also be automated.

You could also create a folder structure with modules & sub-functions and create a full REST API by using Azure Functions with PowerShell:

The latter would also be able to execute in containers & in the supported Azure Function runtimes.

1 Comment

Thank you for your suggestion. I should have clarified that I was looking for something self hosted, rather than cloud based.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.