Thanks a lot Matt and Alexey!
The pure powershell piping by Matt is what I needed.

пятница, 22 апреля 2016 г., 7:03:31 UTC+3 пользователь Aleksey Tsalolikhin 
написал:
>
> Are you quite sure that using the script module is not an option?  It just 
> makes life so much easier not having to deal with "theading the needle" as 
> Matt Davis wrote.
>
> On Thu, Apr 21, 2016 at 9:13 AM, Alexey Larsky <[email protected] 
> <javascript:>> wrote:
>
>> I've stuck with using raw module with double quoted parameters under 
>> Windows.
>> According with http://docs.ansible.com/ansible/intro_windows.html
>> - raw: cmd /c "net use *\\server\share*  & second_command"  works, but *how 
>> to use double quoted parameter(s) with spaces inside cmd /c "..." ?*
>> - raw: cmd /c "net use "*\\server\share with spaces*" & second_command" 
>> throw error: fatal: [...]: FAILED! => {"changed": false, "failed": true, 
>> "invocation": {"module_args": {"_raw_params": "cmd /c \"net use 
>> \"*\\\\**server\share 
>> with spaces*\"\""}, "module_name": "raw"}, "rc": 1, "stderr": "System 
>> error 5 has occurred.\r\n\r\nAccess is denied.\r\n\r\n", "stdout": "", 
>> "stdout_lines": []}
>>
>> PS. Ansible: 2.0.1.0, sever: CentOS Linux release 7.2.1511 (Core), 
>> client: Windows 7 SP1 x64.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/ed6c4623-5355-4986-a512-cb3c16c224a3%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/ed6c4623-5355-4986-a512-cb3c16c224a3%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8ba06cf7-f4f6-4440-a30e-c2fd1be5affc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to