Powershell command
YAML parameters
Name | Type | Description |
---|---|---|
name Required | String | The name of the action. |
type Required | String | The type of the action. Must be set to POWERSHELL . |
targets Required | Target[] | Defines a target (server) for your deployments using the following parameters. Supported target types are: SSH , SFTP , VULTR , DIGITALOCEAN , UPCLOUD . |
command Required | String[] | The array of commands invoked on the remote server. |
working_directory | String | The absolute or relative path on the remote server. |
run_as_script | Boolean | If set to true , commands are executed as a regular script. If set to false, the commands will be executed one by one, in non-interactive mode. |
execute_every_command | Boolean | If set to true all commands will be executed regardless of the result of the previous command. |
Parameters for targets
Name | Type | Description |
---|---|---|
target Required | String | Target identifier |
type Required | String | The type of the target. Possible values: SSH , MATCH , UPCLOUD , VULTR , DIGITAL_OCEAN |
host Required | String | The host for the connection |
auth Required | Auth | Authentication details using the following parameters. |
path | String | Path on the server defined in the target. |
port | String | Port for the connection |
proxy | Proxy | Define a SSH proxy server using the following parameters (available only for SSH targets). |
Parameters for auth in targets
Name | Type | Description |
---|---|---|
method Required | String | Required for SSH, UPCLOUD, VULTR and DIGITAL_OCEAN. Defines authentication method, available values: PASSWORD , SSH_KEY , ASSETS_KEY , PROXY_CREDENTIALS , PROXY_KEY |
username Required | String | The username required to connect to the server. |
password | String | The password required to connect to the server. Required for PASSWORD method. |
asset | String | Name of the variable containing the private key. Required for ASSETS_KEY method. |
passphrase | String | Passphrase for the SSH key. |
key | String | Proxy key used for authentication. For proxy targets only. |
key_path | String | Path to the key on proxy server. Required for method PROXY_KEY . |
Parameters for proxy
Name | Type | Description |
---|---|---|
host | String | Host for the proxy connection. |
port | String | The port for the proxy connection. |
auth | Auth | Define proxy servers' authentication method using the following parameters. |
Examples
Powershell command (Password)
yamlactions: - action: Execute Powershell Commands on Server type: POWERSHELL working_directory: C:/Users commands: - Get-Date | Out-File -Append deployment.log - Get-Service | Where-Object {$_.Status -eq 'Running'} | Select-Object -First 5 - Test-NetConnection -ComputerName 'www.microsoft.com' -Port 443 targets: - example targets: - target: example type: SSH name: example host: 192.0.2.1 port: 22 auth: username: deploy_user password: $MyPassword
Powershell command (SSH Key)
yamltargets: - 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 actions: - action: Execute Powershell Commands on Server type: POWERSHELL working_directory: C:/Users commands: - Get-Date | Out-File -Append deployment.log - "Get-Service | Where-Object {$_.Status -eq 'Running'} | Select-Object -First 5" - Test-NetConnection -ComputerName 'www.microsoft.com' -Port 443 targets: - example
Last modified on Jun 2, 2025