27 lines
916 B
PowerShell
27 lines
916 B
PowerShell
function Get-InstalledSoftware {
|
|
$paths = @(
|
|
"HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*",
|
|
"HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
|
)
|
|
|
|
$software = foreach ($path in $paths){
|
|
Get-ItemProperty $path -ErrorAction SilentlyContinue |
|
|
Where-Object { $_.DisplayName } |
|
|
Select-Object @{
|
|
Name = "Name"; Expression = { $_.DisplayName }
|
|
}, @{
|
|
Name = "Version"; Expression = { $_.DisplayVersion }
|
|
}, @{
|
|
Name = "Publisher"; Expression = { $_.Publisher }
|
|
}, @{
|
|
Name = "InstallDate"; Expression = { $_.InstallDate }
|
|
}
|
|
}
|
|
|
|
return $software | Sort-Object name -Unique
|
|
}
|
|
|
|
$timestamp = Get-Date -Format "MM-dd-yyyy-HH-mm"
|
|
|
|
# Get-InstalledSoftware | Format-Table
|
|
Get-InstalledSoftware | ConvertTo-Json | Out-File "software_$($timestamp).json" |