Use Windows PowerShell with Ansible

3 Comments



Ansible is a very powerful configuration management platform that allows using many different automation tools for configuring your Windows hosts. One of those is Windows PowerShell. How can you use Windows PowerShell with Ansible?

Ansible natively provides modules that allow interacting with your Windows hosts using Powershell. Those are win_powershell, win_command, and win_shell. You can find more information about those here:

Win_powershell:
https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_powershell_module.html

win_command:

https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_command_module.html#ansible-collections-ansible-windows-win-command-module

win_shell:

https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_shell_module.html#ansible-collections-ansible-windows-win-shell-module

You can easily configure your Windows host for Ansible control node communication using the community driven script ConfigureRemotingForAnsible.ps1 script. Read more about that script here:

https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1

Watch my previous video on how to manage Windows with Ansible, showing how to configure Kerberos authentication using Active Directory credentials here:



source

3 Comments
    • blank
      Dustin Silver
      May 04, 2022 17:57 pm Reply

      Great video and extremely helpful with getting started with Ansible! Thank you so much!

    • blank
      Tony G
      May 04, 2022 17:57 pm Reply

      Great Video. I really want to test this out…

    • blank
      Viktor Vodnev
      May 04, 2022 17:57 pm Reply

      Thanks for video, great as always!

Leave us a comment