I have no experience whatsoever with windows modules, but this looks pretty
clear to me:

                "message": "Cannot find path
> 'C:\\Users\\Amitabh.Ghosh\\AppData\\Roaming\\Microsoft\\Windows\\ServerManager\\ServerList.xml'
> because it does not exist.",


Perhaps an escaping issue? According to
https://docs.ansible.com/ansible/latest/os_guide/windows_usage.html when
yaml code is not quoted (like in your situation) the backslash does not
need to be escaped.
Try without the double escapes:

    script: |
            try {
                Get-Process | Where-Object {$_.ProcessName -eq
"ServerManager.exe"} | Stop-Process -Force
                $file = Get-Item
"$env:USERPROFILE\AppData\Roaming\\Microsoft\Windows\ServerManager\ServerList.xml"



-- 
Sent from Gmail Mobile

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAF8BbLYvhXaMo%2B5qb07A8B7tODjonkmQ7z2UVXF0MSyLwbziwg%40mail.gmail.com.

Reply via email to