community.windows.win_psrepository_info module – Gather information about PSRepositories
Note
This module is part of the community.windows collection (version 1.11.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.windows
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.windows.win_psrepository_info
.
Synopsis
Gather information about all or a specific PSRepository.
Requirements
The below requirements are needed on the host that executes this module.
PowerShellGet
module
Parameters
Parameter |
Comments |
---|---|
The name of the repository to retrieve. Supports any wildcard pattern supported by If omitted then all repositories will returned. Default: |
See Also
See also
- community.windows.win_psrepository
Adds, removes or updates a Windows PowerShell repository.
Examples
- name: Get info for a single repository
community.windows.win_psrepository_info:
name: PSGallery
register: repo_info
- name: Find all repositories that start with 'MyCompany'
community.windows.win_psrepository_info:
name: MyCompany*
- name: Get info for all repositories
community.windows.win_psrepository_info:
register: repo_info
- name: Remove all repositories that don't have a publish_location set
community.windows.win_psrepository:
name: "{{ item }}"
state: absent
loop: "{{ repo_info.repositories | rejectattr('publish_location', 'none') | list }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A list of repositories (or an empty list is there are none). Returned: always |
|
The installation policy of the repository. The sample values are the only possible values. Returned: success Sample: |
|
The name of the repository. Returned: success Sample: |
|
The name of the package management provider for this repository. Returned: success Sample: |
|
Provider-specific options for this repository. Returned: success |
|
The location used to publish modules. Returned: success Sample: |
|
Whether the module is registered. Should always be Returned: success |
|
The location used to publish scripts. Returned: success Sample: |
|
The location used to find and retrieve scripts. Returned: success Sample: |
|
The location used to find and retrieve modules. This should always have a value. Returned: success Sample: |
|
A boolean flag reflecting the value of Returned: success |