In this video, the Kilt Guy shows you how to collect and information for installed programs from the Registry using a PowerShell script
Commands used in the shell:
Get-WmiObject
Where-Object
Select-Object
Sort-Object
Add-Member
No chapters this time around, but I do have the full script for you, with some additional comments not shown in the video.
========================
#Create an instance of the Registry Object and open the HKLM base key
$reg=[microsoft.win32.registrykey]::OpenRemoteBaseKey('LocalMachine',$env:computername)
#Define the variable to hold the location of Currently Installed Programs
$UninstallKey="SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
#Drill down into the Uninstall key using the OpenSubKey Method
$regkey=$reg.OpenSubKey($UninstallKey)
#Retrieve an array of strings which contain all the subkey names
$subkeys=$regkey.GetSubKeyNames()
#Open each Subkey and use GetValue Method to return the required values for each
$InstalledPrograms = @()
foreach($key in $subkeys){
$thisKey=$UninstallKey+"\\"+$key
$thisSubKey=$reg.OpenSubKey($thisKey)
$obj = New-Object PSObject
$obj | Add-Member -MemberType NoteProperty -Name "Caption" -Value $($thisSubKey.GetValue("DisplayName"))
$obj | Add-Member -MemberType NoteProperty -Name "Version" -Value $($thisSubKey.GetValue("DisplayVersion"))
$obj | Add-Member -MemberType NoteProperty -Name "InstallDate" -Value $($thisSubKey.GetValue("InstallDate"))
$obj | Add-Member -MemberType NoteProperty -Name "InstallLocation" -Value $($thisSubKey.GetValue("InstallLocation"))
$obj | Add-Member -MemberType NoteProperty -Name "InstallSource" -Value $($thisSubKey.GetValue("InstallSource"))
$obj | Add-Member -MemberType NoteProperty -Name "Publisher" -Value $($thisSubKey.GetValue("Publisher"))
$InstalledPrograms += $obj
}
$InstalledPrograms | Where-Object { $_.Caption } | Select-Object Caption, Version, InstallDate, InstallLocation, InstallSource |
Sort-Object -Descending InstallDate | Format-Table -auto
========================
Auf dieser Seite können Sie das Online-Video PowerShell 27 Finding Installed Programs through the Registry mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Kilts and Computers 15 Dezember 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 520 Mal angesehen und es wurde von 14 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!