community.windows.win_psscript_info – Gather information about installed PowerShell Scripts¶
Note
This plugin is part of the community.windows collection (version 1.3.0).
To install it use: ansible-galaxy collection install community.windows
.
To use it in a playbook, specify: community.windows.win_psscript_info
.
Requirements¶
The below requirements are needed on the host that executes this module.
PowerShellGet
module
Parameters¶
See Also¶
See also
- community.windows.win_psrepository_info
The official documentation on the community.windows.win_psrepository_info module.
- community.windows.win_psmodule_info
The official documentation on the community.windows.win_psmodule_info module.
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:
Authors¶
Brian Scholer (@briantist)