Get Remote Computer Install Software
#requires -Version 2 function Get-Software { param ( [string] $DisplayName='*', [string] $UninstallString='*', [string[]] $ComputerName ) [scriptblock]$code = { param ( [string] $DisplayName='*', [string] $UninstallString='*' ) $keys = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*', 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' $result=Get-ItemProperty -Path $keys | Where-Object { $_.DisplayName } | Select-Object -Property DisplayName, DisplayVersion, UninstallString | Where-Object { $_.DisplayName -like $DisplayName } | Where-Object { $_.UninstallString -like $UninstallString } $result #$f=$result -contains '*autodesk*' } if ($PSBoundParameters.ContainsKey('ComputerName')) { Invoke-Command -ScriptBlock $code -ComputerName $ComputerName -ArgumentList $DisplayName, $UninstallString } else { & $code -DisplayName $DisplayName -UninstallString $UninstallString } } #Get-Software -ComputerName "CNKLCNSHSR2001" Import-Csv "C:\Temp\Logs\pcname.csv" | foreach{ try{ Get-Software -ComputerName $_."pcname" } catch{ } }| export-csv C:\Temp\Logs\pcname_Result.csv -notypeinformation
Thanks & Best Regards!
Javi Zhu 朱佳辉
Mobile: 15900467108
Email: Javi.zhu@outlook.com