Trying to "dir /b c:\Temp"  using a playbook or via adhoc and getting the 
error message below.  It seems to have a problem with "/b" in "Dir /b 
C:\Temp"







*- hosts: all  gather_facts: yes  tasks:   - win_shell: dir /b C:\Temp*

FAILED! => {"changed": true, "cmd": "dir /b C:\\Temp", "delta": 
"0:00:00.839042", "end": "2017-10-11 08:22:02.820065", "failed": true, 
"rc": 1, "start": "2017-10-11 08:22:01.981022", "stderr": "dir : Cannot 
find path 'C:\\b' because it does not exist.\r\nAt line:1 char:65\r\n+ 
[Console]::InputEncoding = New-Object Text.UTF8Encoding $false; dir /b 
\r\nC:\\Temp\r\n+                                                               
  
\r\n~~~~~~~~~~~~~~\r\n    + CategoryInfo          : ObjectNotFound: 
(C:\\b:String) [Get-ChildItem], I \r\n   temNotFoundException\r\n    + 
FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetCh 
\r\n   ildItemCommand", "stderr_lines": ["dir : Cannot find path 'C:\\b' 
because it does not exist.", "At line:1 char:65", "+ 
[Console]::InputEncoding = New-Object Text.UTF8Encoding $false; dir /b ", 
"C:\\Temp", 
"+                                                                 ", 
"~~~~~~~~~~~~~~", "    + CategoryInfo          : ObjectNotFound: 
(C:\\b:String) [Get-ChildItem], I ", "   temNotFoundException", "    + 
FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetCh ", 
"   ildItemCommand"], "stdout": "", "stdout_lines": []}


*ansible -i poc-win all -m raw -a "dir /b C:\Temp"*
 | FAILED | rc=1 >>
*dir : Cannot find path 'C:\b' because it does not exist*.
At line:1 char:1
+ dir /b C:\Temp
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\b:String) 
[Get-ChildItem], I
   temNotFoundException
    + FullyQualifiedErrorId : 
PathNotFound,Microsoft.PowerShell.Commands.GetCh
   ildItemCommand


 *ansible -i poc-win all -m win_shell -a "dir /b C:\Temp"*
 | FAILED | rc=1 >>
dir : Cannot find path 'C:\b' because it does not exist.
At line:1 char:65
+ [Console]::InputEncoding = New-Object Text.UTF8Encoding $false; dir /b
C:\Temp
+
~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\b:String) 
[Get-ChildItem], I
   temNotFoundException
    + FullyQualifiedErrorId : 
PathNotFound,Microsoft.PowerShell.Commands.GetCh
   ildItemCommand


-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/90ce07ed-a116-4d9d-a138-600d6dc8ba0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to