-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollect_software.yaml
24 lines (21 loc) · 953 Bytes
/
collect_software.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
- name: Collect installed software informations
win_shell: |
$items=New-Object System.Collections.ArrayList
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select-Object DisplayName, DisplayVersion, Publisher, InstallLocation,
@{Name='Arch' ; Expression={'x64'}} | ForEach-Object {
$items.Add($_) | Out-Null
}
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select-Object DisplayName, DisplayVersion, Publisher, InstallLocation,
@{Name='Arch' ; Expression={'x86'}} | ForEach-Object {
$items.Add($_) | Out-Null
}
$items | Select-Object DisplayName, DisplayVersion, Publisher,
Arch, InstallLocation | ConvertTo-JSON
args:
no_profile: yes
register: installed_software
- name: display installed software
debug:
var: installed_software.stdout