I ran your script
Code:
$printerport= "$dp.PortName"

I would not use quotes because $dp is a variable
Code:
? "Printer PortName:            " + $dp.PortName

This returns the (IP) port name of my (default) home printer
Your script seems OK to me...