# The path to a text file with one FQDN computer name on each line. # is stored in the StrComputerNamesList variable Foreach ($StrComputerName in (get-Content StrComputerNamesList)){ Invoke-Command -ComputerName StrComputerName -ScriptBlock{ Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" | Select-Object display name, publisher, install date | ConvertTo-Html | Out-File "$SMBShare\Report.html"; }}