YAML examples for Powershell Command
PowerShell deploy script with targets
yaml- action: PowerShell deploy script type: POWERSHELL trigger_time: ON_EVERY_EXECUTION disabled: false working_directory: C:\app commands: - Get-Process - Write-Host 'Deploying application...' - .\deploy.ps1 execute_every_command: true run_as_script: true targets: - target: windows-prod type: SSH name: Windows Production Server host: windows-server.example.com port: "5986" auth: method: PASSWORD username: admin password: secret123 ignore_errors: false retry_interval: 30 retry_count: 2 timeout: 3600
Simple PowerShell command
yaml- action: PowerShell command type: POWERSHELL trigger_time: ON_EVERY_EXECUTION commands: - Get-Date targets: - "my-ssh-target"
PowerShell with password authentication target
yaml- action: "PowerShell deploy" type: "POWERSHELL" trigger_time: ON_EVERY_EXECUTION commands: - Get-Date targets: - target: example type: SSH name: example host: 192.0.2.1 port: "22" auth: method: PASSWORD username: deploy_user password: $MyPassword
PowerShell with SSH key authentication target
yaml- action: "PowerShell deploy" type: "POWERSHELL" trigger_time: ON_EVERY_EXECUTION commands: - Get-Date targets: - target: example type: SSH name: example host: 192.0.2.1 auth: method: SSH_KEY username: deploy_user password: $MyPassword passphrase: $PassPhrase key: $Ssh_Key