community.windows.win_psscript_info module – Gather information about installed PowerShell Scripts
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_psscript_info
.
Synopsis
Gather information about PowerShell Scripts installed via PowerShellGet.
Requirements
The below requirements are needed on the host that executes this module.
PowerShellGet
module
Parameters
Parameter |
Comments |
---|---|
The name of the script. Supports any wildcard pattern supported by If omitted then all scripts will returned. Default: |
|
The name of the PSRepository the scripts were installed from. This acts as a filter against the scripts that would be returned based on the name option. Only scripts installed from a registered repository will be returned. If the repository was re-registered after script installation with a new |
See Also
See also
- community.windows.win_psrepository_info
Gather information about PSRepositories.
- community.windows.win_psmodule_info
Gather information about PowerShell Modules.
Examples
- name: Get info about all script on the system
community.windows.win_psscript_info:
- name: Get info about the Test-RPC script
community.windows.win_psscript_info:
name: Test-RPC
- name: Get info about test scripts
community.windows.win_psscript_info:
name: Test*
- name: Get info about all scripts installed from the PSGallery repository
community.windows.win_psscript_info:
repository: PSGallery
register: gallery_scripts
- name: Update all scripts retrieved from above example
community.windows.win_psscript:
name: "{{ item }}"
state: latest
loop: "{{ gallery_scripts.scripts | map(attribute=name) }}"
- name: Get info about all scripts on the system
community.windows.win_psscript_info:
register: all_scripts
- name: Find scripts installed from a repository that isn't registered now
set_fact:
missing_repository_scripts: "{{
all_scripts
| json_query('scripts[?repository!=null && repository==repository_source_location].{name: name, version: version, repository: repository}')
| list
}}"
- debug:
var: missing_repository_scripts
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A list of installed scripts (or an empty list is there are none). Returned: always |
|
Additional metadata included with the script or during publishing of the script. Many of the fields here are surfaced at the top level with some standardization. The values here may differ slightly as a result. The field names here vary widely in case, and are not normalized or converted to snake_case. Returned: success |
|
The author of the script. Returned: success Sample: |
|
The company name of the script. Returned: success Sample: |
|
The copyright of the script. Returned: success Sample: |
|
The script’s dependencies. Returned: success |
|
The description of the script. Returned: success Sample: |
|
The address of the icon of the script. Returned: success Sample: |
|
The date the script was installed. Returned: success Sample: |
|
The path where the script is installed. Returned: success Sample: |
|
The address of the license for the script. Returned: success Sample: |
|
The name of the script. Returned: success Sample: |
|
This is the PowerShellGet package management provider used to install the script. Returned: success Sample: |
|
The version of the PowerShellGet specification format. Returned: success Sample: |
|
The address of the script’s project. Returned: success Sample: |
|
The date the script was published. Returned: success Sample: |
|
The script’s release notes. This is a free text field and no specific format should be assumed. Returned: success Sample: |
|
The PSRepository where the script 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 script was installed from. Returned: success Sample: |
|
The tags defined in the script’s Returned: success Sample: |
|
The date the script was last updated. Returned: success Sample: |
|
The script version. Returned: success Sample: |