I have compiled the following script that lists all installed applications on the local system and writes them to a log file, but I don’t know how to get the same result when using PSRemoteRegistry, the actual input list I need will be all deleted targets.
Does anyone have experience installing the same code in cmdlets available through PSRemoteRegistry? In particular, I need to list the display name of each installed application found in the HKLM key: \ Software \ Microsoft \ CurrentVersion \ Uninstall
I need help with PSRemoteRegistry cmdlets:
Get-ChildItem 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall' | ForEach-Object {Log (Get-ItemProperty $_.pspath).DisplayName}
and this is the whole script:
clear
$Logfile = "C:\temp\installed_apps.log"
Function Log
{
param([string]$logstring)
Add-Content $Logfile -Value $logstring
}
$target_list = Get-Content -Path c:\temp\installed_apps_targets.txt
foreach ($system in $target_list){
if (test-connection $system -quiet)
{
Log "---------------Begin $system---------------"
Get-ChildItem 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall' | ForEach-Object {Log (Get-ItemProperty $_.pspath).DisplayName}
Log "---------------End $system---------------"
}
else
{
Log "**************$system was unreachable**************"
}
}
source
share