Powershell Command
- PATCH
- /workspaces
- /:workspace
- /projects
- /:project_name
- /pipelines
- /:pipeline_id
- /actions
- /:action_id
Update Powershell Command action configuration
Warning
You can't change the type of an existing action. To change the type, remove the action and add it again.
Request example
curl -X PATCH "https://api.buddy.works/workspaces/:workspace/projects/:project_name/pipelines/:pipeline_id/actions/:action_id" \
-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