Hi there!
I am trying to combine output from cmdlets into one csv file.
I want to take the following as an example:
- gwmi Win32_OperatingSystem -ComputerName $Computers |Select-Object Version
- Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select DisplayName, DisplayVersion | where { $_.DisplayName -like"*Citrix*" }Actually, my script looks like this :
$Computers = Get-Content .\comp.txt
foreach ( $name in $Computers ) {
write-Host "Testing Network Connection with $name" -ForegroundColor Green
if ( Test-Connection $name -Count 1 -Quiet ) {
write-Host "Getting software information." -ForegroundColor Magenta -BackgroundColor White
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select DisplayName, DisplayVersion | where { $_.DisplayName -like"*Citrix*" }
}else {
write-Host " $name is not found or not reachable." -ForegroundColor white -BackgroundColor Red
}
}Any help would be appriciated :o)
Thank you