0

Is it possible to make my powershell script, run as a microservice?

Param(
    $a,
    $b
)

$x = [int]$a + [int]$b

echo $x
6
  • A microservice in what way? Commented Nov 25, 2016 at 14:28
  • What's a microservice, exactly? In particular in the context of Windows scripting. Commented Nov 25, 2016 at 14:28
  • I want to run my script, as an service accepting http requests of type HTTP GET on address localhost:port/sum?a=1&b=2, and respond with the content 3. Commented Nov 25, 2016 at 14:51
  • 2
    Powershell can run an HTTP server. You should start researching the topic and decide which of the various options you like. If you have decided on an option and have a specific question, you are welcome to ask it. A quick search turned up this Gist: gist.github.com/wagnerandrade/5424431, but there are more examples to get you started. Commented Nov 25, 2016 at 15:05
  • 1
    i disagree, running web server in a Powershell is hell of a mess + doesnt help with distributing load and stuff like that Commented Nov 25, 2016 at 19:27

1 Answer 1

1

Actually, you should take a look at Azure Functions, they achieve exactly that what you want and they support PowerShell/

https://david-obrien.net/2016/07/azure-functions-PowerShell/

https://azure.microsoft.com/en-us/services/functions/

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

Comments

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.