New in version 2.8.
This module helps to add, remove and update Windows PowerShell repository on Windows-based systems.
Parameter | Choices/Defaults | Comments |
---|---|---|
installation_policy
string
|
|
Sets the
InstallationPolicy of a repository.Will default to
trusted when creating a new repository. |
name
string
/ required
|
Name of the repository to work with.
|
|
source
string
|
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.
|
|
state
string
|
|
If
present a new repository is added or updated.If
absent a repository is removed. |
Note
PowerShell modules needed - PowerShellGet >= 1.6.0 - PackageManagement >= 1.1.7
PowerShell package provider needed - NuGet >= 2.8.5.201
See the examples on how to update the NuGet package provider.
You can not use win_psrepository
to re-register (add) removed PSGallery, use the command Register-PSRepository -Default
instead.
See also
The official documentation on the win_psmodule module.
---
- name: Ensure the required NuGet package provider version is installed
win_shell: Find-PackageProvider -Name Nuget -ForceBootstrap -IncludeDependencies -Force
- name: Add a PowerShell module and register a repository
win_psrepository:
name: MyRepository
source: https://myrepo.com
state: present
- name: Remove a PowerShell repository
win_psrepository:
name: MyRepository
state: absent
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Wojciech Sciesinski (@it-praktyk)
Hint
If you notice any issues in this documentation you can edit this document to improve it.