appleboy / appleboy/ssh-action

Unable to run multiple commands on windows servers

Open
#189 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
6.2k
Forks
679
Avg merge
35m
Merged PRs (30d)
1

Description

Unable to run multiple commands on windows server. Only the first command is getting executed.

```
- name: SSH to Windows Node
uses: appleboy/ssh-action@1a8b3784eaa665f677fa114edd5683bb6a6bfaa8 # master hash on July 12, 2021 (newer than v0.1.4)
continue-on-error: true
with:
script: |
powershell.exe
$service = Get-Service twistlockDefender -ErrorAction SilentlyContinue
$script={ if ("$args[0]" -match "Running") { echo 'Service Already Installed' } else { echo 'Service Installation Needed' }}
powershell.exe -Command $script -args $service.status
host: << HOST_IP >>
username: << HOST_USERNAME >>
password: << HOST_PASSWORD >>
```

![image](https://user-images.githubusercontent.com/79187874/194806235-c4131690-89b6-47bc-acc8-5bed4128ad6f.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.