Thanks Jordan, very informative, I will try options which you mentioned.

On Sat, 18 Apr, 2020, 12:53 AM Jordan Borean, <[email protected]> wrote:

> The proper way is to use the script module
>
> - name: run script
>   script: test.ps1
>
> It will automatically try and find 'test.ps1' in various folder, the files
> folder adjacent to the playbook is one of them, copy it across, execute,
> then delete the file all in 1 go. If you truly don't want to copy across
> the file then your only option is to read the script using the lookup
> plugin and use it with win_shell
>
> - name: run script in memory
>   win_shell: '{{ lookup("file", "test.ps1") }}'
>
> If this is a really large script you might read some command line length
> limits so it's not always possible to do this.
>
> --
> 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/72a3b823-dcc1-4932-94f0-9e681e4a577f%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/72a3b823-dcc1-4932-94f0-9e681e4a577f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAGwKPnf%2B5f2mrJ4hk_PD_WDuXdX9RNjp-cFMPod5n19b9f5CNg%40mail.gmail.com.

Reply via email to