You can use the 'raw' module to run a powershell script that is already on 
the remote machine (or any exe), and you can use the 'script' module to 
have ansible transfer the powershell script from your ansible controller to 
your managed host and then run the powershell script.

If possible though, use the windows modules for controlling your Windows 
machines (or create your own), they integrate better with the rest of 
ansible (you can take control of whether ansible returns 'ok' or 'changed' 
with your own module).

If you are able to clone ansible from github there are many useful examples 
of using raw, script and other windows modules in the 
test/integration/roles/ dirs

Hope this helps,

Jon

On Wednesday, July 22, 2015 at 5:55:41 PM UTC+1, Dimitri Yioulos wrote:
>
> Apologies for what must be a very dumb question, but how do I run a 
> Powershell script which is located on a remote Windows machine?  And, can I 
> run a script that's located on the Ansible host?
>
> Many thanks!
>

-- 
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/2efadc9e-05b9-43bd-a2d1-173d4f4701b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to