community.windows.win_psrepository_info
Gather information about PSRepositories
- Gather information about all or a specific PSRepository.
The below requirements are needed on the host that executes this module.
Parameter |
Choices/Defaults |
Comments |
name
string
|
Default:
"*"
|
The name of the repository to retrieve.
Supports any wildcard pattern supported by Get-PSRepository .
If omitted then all repositories will returned.
|
.. seealso::
:ref:`community.windows.win_psrepository_module`
The official documentation on the **community.windows.win_psrepository** module.
- 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 }}"
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
repositories
list
/ elements=dictionary
|
always |
A list of repositories (or an empty list is there are none).
|
|
installation_policy
string
|
|
The installation policy of the repository. The sample values are the only possible values.
Sample:
['Trusted', 'Untrusted']
|
|
name
string
|
|
The name of the repository.
Sample:
PSGallery
|
|
package_management_provider
string
|
|
The name of the package management provider for this repository.
Sample:
NuGet
|
|
provider_options
dictionary
|
|
Provider-specific options for this repository.
|
|
publish_location
string
|
|
The location used to publish modules.
Sample:
|
|
registered
boolean
|
|
Whether the module is registered. Should always be True
|
|
script_publish_location
string
|
|
The location used to publish scripts.
Sample:
|
|
script_source_location
string
|
|
The location used to find and retrieve scripts.
Sample:
|
|
source_location
string
|
|
The location used to find and retrieve modules. This should always have a value.
Sample:
|
|
trusted
boolean
|
|
A boolean flag reflecting the value of installation_policy as to whether the repository is trusted.
|
- Brian Scholer (@briantist)