Hello I am trying to query wmi data and export it to a csv, how ever I cant seem to get multiple wmi data to append to the same file. I don't know why you can't chain the command.
$computers = Get-Content -Path C:\machines.txt $computers = $computers.Trim() $test = Get-WmiObject win32_Bios -cn $computers | Select-Object Description,SerialNumber $test2 = Get-WmiObject Win32_Computersystem -cn $computers | Select-Object Domain,Manufacturer,Model,Name,NumberOfProcessors $test2 | Export-CSV -Path "C:\Users\Public\outputfile.csv" -notypeinformation $test | Export-CSV -Path "C:\Users\Public\outputfile.csv" -append -Force
Thank you for you help.