win_shell module with multiple lines not working

Hi guys.

This is my code:

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)
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

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://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.