win_command win_shell: add stdin option (#31619)

This commit is contained in:
Jordan Borean 2017-10-23 09:50:19 +10:00 committed by GitHub
commit 8e44cd5d10
6 changed files with 85 additions and 4 deletions

View file

@ -188,3 +188,17 @@
- shellout.stdout is search("doneout")
- shellout.stderr is search("starterror")
- shellout.stderr is search("doneerror")
- name: run stdin test
win_shell: '$string = [Console]::In.ReadToEnd(); Write-Output $string.Trim()'
args:
stdin: some input
register: shellout
- name: assert run stdin test
assert:
that:
- shellout|changed
- shellout.rc == 0
- shellout.stderr == ""
- shellout.stdout == "some input\r\n"