Closed nicas4100 closed 3 years ago
What do you mean by HTTP parameter?
i have created an API that can execute a script to extend a user account, i want the api to take a argument and use that together with the powershell script
so something like this:
yes exactly
i just cant figure out how to make the route and how to direct it to the reqeustcommand
yes! - take a look at the example here: https://github.com/jpsider/RestPS/blob/master/RestPS/endpoints/GET/Invoke-GetProcess.ps1
thank you very much i will try it
very nice project btw
Thanks! the example is a little rough around the edges, but should do what you need. if you have any issues, let me know.
when i create the route what should i write in the RequestArgs field? "RequestType": "GET", "RequestURL": "/expand-user", "RequestCommand": "C:/Users/Administrator/Documents/expandExpireDate.ps1", "RequestArgs":
You don't need to add anything. That line in the routes file, is just to provide data when you run the endpoint to display the available routes. But has no bearing on the function of the actual endpoint you are working on. (kinda a bad design on my part)
okay thank you then it makes more sense
I got it working thank you very much for your quick response
fantastic!
is it possible to parse a http parameter as an argument to the powershell script the api is executing?