I have a PowerShell script. This:

Get-Printer | ft name,portname,location | Export-Csv c:\intel\intvprint2.csv -NoTypeInformation

But it isn't any good :( I made the script, but the result is file error data.

This it makes:


But now see this:

Get-Printer | ft name,portname,location

name                          portname               location
----                          --------               --------
9620HP2055DN                 loc1
9590HP2055DN                  loc2

Why isn't the script good?


1 Answer 1


ft is an alias for Format-Table, which is meant to output the data pretty in a terminal. You want to use Select-Object (alias select) instead.

Get-Printer | select name,portname,location | Export-Csv c:\intel\intvprint2.csv -NoTypeInformation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.