Powershell: Making a RESTful API endpoint in powershell (kinda like python flask)
Summary:
While running scripts interactively and even on a scheduled basis is fine, I wanted to explore the possibility of making my scripts event-driven. Take the vCheck Health Script for example. Running that on a schedule is fine, but what if I wanted to run that on-demand? Or other scripts in general?
The cool thing, you can do it all in Powershell Core! Meaning, docker, linux, macOS, etc. Basically, you can have this script run on OS startup (pre-populated with your endpoint configs/scripts) and you would have a Powershell driven REST-style API endpoint to run your scripts.
Here is the example, feel free to try it. It'll do nothing of consequence on it's own. I'll post later with a video on how to use it.
While running scripts interactively and even on a scheduled basis is fine, I wanted to explore the possibility of making my scripts event-driven. Take the vCheck Health Script for example. Running that on a schedule is fine, but what if I wanted to run that on-demand? Or other scripts in general?
The cool thing, you can do it all in Powershell Core! Meaning, docker, linux, macOS, etc. Basically, you can have this script run on OS startup (pre-populated with your endpoint configs/scripts) and you would have a Powershell driven REST-style API endpoint to run your scripts.
Here is the example, feel free to try it. It'll do nothing of consequence on it's own. I'll post later with a video on how to use it.
Comments