ansible / ansible.builtin / v2.6.0 / module / win_psmodule Adds or removes a Powershell Module | "added in version" 2.4 of ansible.builtin" Authors: Daniele Lazzari preview | supported by communityansible.builtin.win_psmodule (v2.6.0) — module
pip
Install with pip install ansible==2.6.0
This module helps to install Powershell modules and register custom modules repository on Windows Server.
--- - name: Add a powershell module win_psmodule: name: PowershellModule state: present
- name: Add a powershell module and register a repository win_psmodule: name: MyCustomModule repository: MyRepository url: https://myrepo.com state: present
- name: Add a powershell module from a specific repository win_psmodule: name: PowershellModule repository: MyRepository state: present
- name: Remove a powershell module win_psmodule: name: PowershellModule state: absent
- name: Remove a powershell module and a repository win_psmodule: name: MyCustomModule repository: MyRepository state: absent
url: description: - URL of the custom repository to register. name: description: - Name of the powershell module that has to be installed. required: true state: choices: - absent - present default: present description: - If C(present) a new module is installed. - If C(absent) a module is removed. repository: description: - Name of the custom repository to register or use. allow_clobber: default: 'no' description: - If C(yes) imports all commands, even if they have the same names as commands that already exists. Available only in Powershell 5.1 or higher. type: bool
nuget_changed: description: true when Nuget package provider is installed returned: always sample: true type: boolean output: description: a message describing the task result. returned: always sample: Module PowerShellCookbook installed type: string repository_changed: description: true when a custom repository is installed or removed returned: always sample: true type: boolean