npm install
npm run dev
npm start
-
Open Postman.
-
Create a new request:
- Set the request type to POST.
- Enter the URL:
http://localhost:<PORT>/run.
-
In the Headers tab, add a new header:
- Key:
Content-Type
- Value:
application/json
- Key:
-
Switch to the Body tab, select the raw option, and enter the JSON data for your request.
-
For running a script:
{ "path": "your_script_path.ps1" }
-
For running a command:
{ "command": "Get-Process" }
Make sure to replace
"your_script_path.ps1"
with the actual path to your PowerShell script. -
-
Click the "Send" button to make the request.
-
Check the response in the "Body" section of the response to see the output of your PowerShell script or command.