Install PowerShell Modules With Ansible for Windows

In this blog post, I will show you how to install PowerShell modules on managed Windows machines with Ansible.

Ansible for Windows 

With Ansible Windows modules we can manage Windows Server and Windows 10 machines using the same look and feel of Ansible for Linux. make sure you visit the blog series about how to get started with Ansible for Windows.


For PowerShell modules installation Ansible is using the win_psmodule, module which handles the installation and uninstallation of modules from a managed machines.

In the Paylbook below, I am going to install a PowerShell module called ActiveDirectoryDsc which is available in the PowerShell gallery.

- name: "Work With Active Directory Machines"
  hosts: windows
    - name: "Install PowerShell Module" 
            name: ActiveDirectoryDsc
            state: present


Success! You're on the list.