Using Select-Object in that way is sort of a nice shorthand for something like this:
$creds = Get-Credential Get-ADComputer -Filter 'OperatingSystem -like "*2008*"' | ForEach-Object { $computer = $_ $snmpObject = Get-WmiObject -ComputerName $computer.Name -Credential $creds -Query "select *from win32_ServerFeature where name = 'snmp service' " if ($snmpObject -ne $null) { $isSnmpInstalled = $true } else { $isSnmpInstalled = $false } New-Object psobject -Property @{ ComputerName = $computer.Name SNMPInstalled = $isSnmpInstalled } } | Export-Csv c:\servers\SNMPInstalled.csv -NoTypeInformation
They both get you PSObjects with the same properties, but I prefer how the pipeline looks when there’s not a big ForEach-Object loop stuck in the middle of it.