Powershell Command
- POST
- /workspaces
- /:workspace
- /projects
- /:project_name
- /pipelines
- /:pipeline_id
- /actions
Creates a new Powershell Command action in the pipeline
Request example
curl -X POST "https://api.buddy.works/workspaces/:workspace/projects/:project_name/pipelines/:pipeline_id/actions" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Deploy PowerShell Scripts to Windows Server",
"type": "POWERSHELL",
"trigger_time": "ON_EVERY_EXECUTION",
"working_directory": "C:\\Deployment\\Scripts",
"commands": [
"Write-Host \"Starting deployment\"",
"Stop-Service MyAppService -Force",
"Copy-Item -Path .\\* -Destination C:\\Apps\\MyApp -Recurse -Force",
"Start-Service MyAppService",
"Get-Service MyAppService"
],
"targets": [
{
"type": "SSH",
"identifier": "prod_win_server",
"host": "10.0.1.50",
"port": "22",
"auth": {
"method": "PASSWORD",
"username": "deploy_user",
"password": "$DEPLOY_PASSWORD"
}
}
],
"run_as_script": true,
"execute_every_command": false
}'STATUS200 OK