Oops. My bad.

I typed the script straight into the post, and a couple of typos have crept in where I converted it from inline code to a UDF as I was typing.

change this line:
Code:
$asPrinterBits=Split($sPrinterPath,"\")



to:
Code:
$asPrinterBits=Split($sPrinter,"\")