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.

Win_PSmodle 

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
  tasks:
    - name: "Install PowerShell Module" 
      win_psmodule:
            name: ActiveDirectoryDsc
            state: present

 

Processing…
Success! You're on the list.

Posted

in

by