ansible.builtin.win_psrepository (v2.9.27) — module

Adds, removes or updates a Windows PowerShell repository.

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

Authors: Wojciech Sciesinski (@it-praktyk)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

This module helps to add, remove and update Windows PowerShell repository on Windows-based systems.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: Ensure the required NuGet package provider version is installed
  win_shell: Find-PackageProvider -Name Nuget -ForceBootstrap -IncludeDependencies -Force
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a PowerShell module and register a repository
  win_psrepository:
    name: MyRepository
    source: https://myrepo.com
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a PowerShell repository
  win_psrepository:
    name: MyRepository
    state: absent

Inputs

    
name:
    description:
    - Name of the repository to work with.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - If C(present) a new repository is added or updated.
    - If C(absent) a repository is removed.
    type: str

source:
    description:
    - Specifies the URI for discovering and installing modules from this repository.
    - A URI can be a NuGet server feed (most common situation), HTTP, HTTPS, FTP or file
      location.
    type: str

installation_policy:
    choices:
    - trusted
    - untrusted
    description:
    - Sets the C(InstallationPolicy) of a repository.
    - Will default to C(trusted) when creating a new repository.
    type: str

See also