ansible.builtin.win_psmodule (v2.4.3.0-1) — module

Adds or removes a Powershell Module.

| "added in version" 2.4 of ansible.builtin"

Authors: Daniele Lazzari

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.4.3.0.post1

Description

This module helps to install Powershell modules and register custom modules repository on Windows Server.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: Add a powershell module
  win_psmodule:
    name: PowershellModule
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a powershell module and register a repository
  win_psmodule:
    name: MyCustomModule
    repository: MyRepository
    url: https://myrepo.com
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a powershell module
  win_psmodule:
    name: PowershellModule
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a powershell module and a repository
  win_psmodule:
    name: MyCustomModule
    repository: MyRepository
    state: absent

Inputs

    
url:
    description:
    - Url of the custom repository.

name:
    description:
    - Name of the powershell module that has to be installed.
    required: true

state:
    choices:
    - present
    - absent
    default: present
    description:
    - If present a new module is installed. If absent a module is removed.

repository:
    description:
    - Name of the custom repository to register.

allow_clobber:
    choices:
    - false
    - true
    default: false
    description:
    - If yes imports all commands, even if they have the same names as commands that already
      exists. Available only in Powershell 5.1 or higher.

Outputs

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