1.7 KiB
Get-InstalledSoftware
Donnerstag, 31. August 2017
17:43
function Get-InstalledSoftware
{
param
(
$DisplayName='*',
$DisplayVersion='*',
$UninstallString='*',
$InstallDate='*'
)
# registry locations where installed software is logged
$pathAllUser = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
$pathCurrentUser = "Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
$pathAllUser32 = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$pathCurrentUser32 = "Registry::HKEY_CURRENT_USER\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
# get all values
Get-ItemProperty -Path $pathAllUser, $pathCurrentUser, $pathAllUser32, $pathCurrentUser32 |
# choose the values to use
Select-Object -Property DisplayVersion, DisplayName, UninstallString, InstallDate |
# skip all values w/o displayname
Where-Object DisplayName -ne $null |
# apply user filters submitted via parameter:
Where-Object DisplayName -like $DisplayName |
Where-Object DisplayVersion -like $DisplayVersion |
Where-Object UninstallString -like $UninstallString |
Where-Object InstallDate -like $InstallDate |
# sort by displayname
Sort-Object -Property DisplayName
}
Aus <https://outlook.office.com/owa/?realm=ralfkoop.de&exsvurl=1&ll-cc=1031&modurl=0>
#nochzubearbeiten