# win\_shell module with multiple lines not working

**URL:** <https://forum.ansible.com/t/win-shell-module-with-multiple-lines-not-working/32308>\
**Category:** Ansible Project\
**Created:** [February 23, 2020, 11:45am UTC](https://forum.ansible.com/t/win-shell-module-with-multiple-lines-not-working/32308 "2020-02-23T11:45:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yehuda\_Pinhas](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@Yehuda\_Pinhas](https://forum.ansible.com/u/Yehuda_Pinhas)\
**Post date:** [February 23, 2020, 11:45am UTC](https://forum.ansible.com/t/win-shell-module-with-multiple-lines-not-working/32308/1 "2020-02-23T11:45:56Z")

</div>

**Hi guys**.

**This is my code** :

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 23, 2020, 2:06pm UTC](https://forum.ansible.com/t/win-shell-module-with-multiple-lines-not-working/32308/2 "2020-02-23T14:06:12Z")

</div>

Hii

You are trying to execute multiple commands with the win\_shell module,  
but according to the docs  
([https://docs.ansible.com/ansible/latest/modules/win\_shell\_module.html#synopsis](https://docs.ansible.com/ansible/latest/modules/win_shell_module.html#synopsis))  
that support one at a time:

"The win\_shell module takes the command name followed by a list of  
space-delimited arguments."

Simple solution: use multiple win\_shell tasks.

Dick

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [February 23, 2020, 6:57pm UTC](https://forum.ansible.com/t/win-shell-module-with-multiple-lines-not-working/32308/3 "2020-02-23T18:57:56Z")

</div>

It’s totally possible you just need to learn how to do multi lined yaml values. Have a look at the 5th example at [https://docs.ansible.com/ansible/latest/modules/win\_shell\_module.html#examples](https://docs.ansible.com/ansible/latest/modules/win_shell_module.html#examples).

[https://yaml-multiline.info/](https://yaml-multiline.info/) is a great tool that can help you understand how multi lined strings work in yaml and the difference between folded and literal block style symbols are.
