community.windows.win_psmodule_info module – Gather information about PowerShell Modules
Note
This module is part of the community.windows collection (version 2.3.0).
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_psmodule_info
.
Synopsis
Gather information about PowerShell Modules including information from PowerShellGet.
Requirements
The below requirements are needed on the host that executes this module.
PowerShellGet
module
Parameters
Parameter |
Comments |
---|---|
The name of the module to retrieve. Supports any wildcard pattern supported by If omitted then all modules will returned. Default: |
|
The name of the PSRepository the modules were installed from. This acts as a filter against the modules that would be returned based on the name option. Modules that were not installed from a repository will not be returned if this option is set. Only modules installed from a registered repository will be returned. If the repository was re-registered after module installation with a new |
See Also
See also
- community.windows.win_psrepository_info
Gather information about PSRepositories.
- community.windows.win_psscript_info
Gather information about installed PowerShell Scripts.
Examples
- name: Get info about all modules on the system
community.windows.win_psmodule_info:
- name: Get info about the ScheduledTasks module
community.windows.win_psmodule_info:
name: ScheduledTasks
- name: Get info about networking modules
community.windows.win_psmodule_info:
name: Net*
- name: Get info about all modules installed from the PSGallery repository
community.windows.win_psmodule_info:
repository: PSGallery
register: gallery_modules
- name: Update all modules retrieved from above example
community.windows.win_psmodule:
name: "{{ item }}"
state: latest
loop: "{{ gallery_modules.modules | map(attribute=name) }}"
- name: Get info about all modules on the system
community.windows.win_psmodule_info:
register: all_modules
- name: Find modules installed from a repository that isn't registered now
set_fact:
missing_repository_modules: "{{
all_modules
| json_query('modules[?repository!=null && repository==repository_source_location].{name: name, version: version, repository: repository}')
| list
}}"
- debug:
var: missing_repository_modules
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A list of modules (or an empty list is there are none). Returned: always |
|
The module’s access mode. See https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.moduleaccessmode Returned: success Sample: |
|
The author of the module. Returned: success Sample: |
|
The CLR version of the module. Returned: success Sample: |
|
The company name of the module. Returned: success Sample: |
|
The PS Editions the module is compatible with. Returned: success Sample: |
|
The copyright of the module. Returned: success Sample: |
|
The modules required by this module. Returned: success |
|
The description of the module. Returned: success Sample: |
|
The .Net Framework version of the module. Returned: success Sample: |
|
The aliases exported from the module. Returned: success Sample: |
|
The cmdlets exported from the module. Returned: success Sample: |
|
All of the commands exported from the module. Includes functions, cmdlets, and aliases. Returned: success Sample: |
|
The DSC resources exported from the module. Returned: success Sample: |
|
The format files exported from the module. Returned: success Sample: |
|
The functions exported from the module. Returned: success Sample: |
|
The type files exported from the module. Returned: success Sample: |
|
The variables exported from the module. Returned: success Sample: |
|
The workflows exported from the module. Returned: success |
|
The files included in the module. Returned: success Sample: |
|
The GUID of the module. Returned: success Sample: |
|
The help info address of the module. Returned: success Sample: |
|
The address of the icon of the module. Returned: success Sample: |
|
The date the module was installed. Returned: success Sample: |
|
The path where the module is installed. This should have the same value as Returned: success Sample: |
|
The address of the license for the module. Returned: success Sample: |
|
Determines whether pipeline execution detail events should be logged. Returned: success |
|
The path that contains the module’s files. Returned: success Sample: |
|
A list of modules packaged with this module. This value is not often returned and the modules are not automatically processed. Returned: success |
|
The GUID of the module. Returned: success Sample: |
|
The maximum version of the module. Returned: success Sample: |
|
The name of the module. This may also be a path to the module file. Returned: success Sample: |
|
The exact version of the module required. Returned: success Sample: |
|
The minimum version of the module. Returned: success Sample: |
|
The module’s type. See https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.moduletype Returned: success Sample: |
|
The name of the module. Returned: success Sample: |
|
A list of modules nested with and loaded into the scope of this module. This list contains full module objects, so each item can have all of the properties listed here, including Returned: success |
|
If the module was installed from PowerShellGet, this is the package management provider used. Returned: success Sample: |
|
The path to the module. Returned: success Sample: |
|
The name of the PowerShell host that the module requires. Returned: success Sample: |
|
The version of the PowerShell host that the module requires. Returned: success Sample: |
|
The minimum version of PowerShell that the module requires. Returned: success Sample: |
|
The default prefix applied to Returned: success |
|
Arbitrary private data used by the module. This is typically defined in the module manifest. This module limits the depth of the data returned for module types other than The Returned: success Sample: |
|
The module’s processor architecture. See https://docs.microsoft.com/en-us/dotnet/api/system.reflection.processorarchitecture Returned: success Sample: |
|
The address of the module’s project. Returned: success Sample: |
|
The date the module was published. Returned: success Sample: |
|
The module’s release notes. This is a free text field and no specific format should be assumed. Returned: success Sample: |
|
The PSRepository where the module was installed from. This value is not historical. It depends on the PSRepositories that are registered now for the current user. The If there is no match, then this value will match Returned: success Sample: |
|
The source location of the repository where the module was installed from. Returned: success Sample: |
|
A list of assemblies that the module requires. The values may be a simple name or a full path. Returned: success Sample: |
|
A list of modules required by this module. This list contains full module objects, so each item can have all of the properties listed here, including These module objects may not contain full information however, so you may see different results than if you had directly queried the module. Returned: success |
|
The root module as defined in the manifest. This may be a module name, filename, or full path. Returned: success Sample: |
|
A list of scripts ( This value comes from the Returned: success Sample: |
|
The tags defined in the module’s Returned: success Sample: |
|
The date the module was last updated. Returned: success Sample: |
|
The module version. Returned: success Sample: |