Powershell script runs locally but when run via ansible playbook doesn't produce the expected results.

Hello Darshan,

Could you please try to below

(attachments)

Hello Avinash,

Thanks for your response. And sorry for this duplicate post. (I missed the response from other community members) The original post is here: https://groups.google.com/d/msg/ansible-project/LGtMnY3b32E/XN5bRkBwCQAJ

The script module never worked for me.

fatal: [10.0.0.96]: FAILED! => {“changed”: false, “msg”: “Could not find or access ‘C:UsersAdministratorDocumentsservice.ps1’\nSearched in:\n\t/home/ec2-user/site-warmup/gs-int/files/C:UsersAdministratorDocumentsservice.ps1\n\t/home/ec2-user/site-warmup/gs-int/C:UsersAdministratorDocumentsservice.ps1\n\t/home/ec2-user/site-warmup/gs-int/files/C:UsersAdministratorDocumentsservice.ps1\n\t/home/ec2-user/site-warmup/gs-int/C:UsersAdministratorDocumentsservice.ps1 on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option”}

I tried to copy the script using the win_copy module and set the remote_src to true. It kept failing with the weird message. I didn’t spend much time on it as I thought of using win_shell instead.

Can we discuss this on the original post please?

Regards,
Darshan