hello i am trying to export to csv; all of the devices found on multiple computers using powershell and wmi, when trying to capture either printer data or pnp, i am only able to loop 1 data value to export to my csv. here is a little snippet, right now i am just trying to gather pnp data.
$computers = Get-Content -Path C:\machines.txt
$computers | foreach-object {
$PrintInfos = get-wmiobject Win32_PnPEntity -cn $_
ForEach ($PrintInfo in $PrintInfos)
{
$props=[ordered]@{ "ComputerName" = $_"DeviceID" = $PrintInfo.Name
}
}
new-object PSObject -property $props #
} | Sort ComputerName | Export-csv C:\Users\Public\outputfile.csv -notypeinformationThank you for the help.