I’m trying to script sending output to a printer, and the command is outputting unusually formatted errors (not PS errors). When I run this:
“Test document.” | Out-Printer -Name “\print\printer”
I get this:
321s191ms678us ERROR: IoChannel::GetNetworkAddress() failed calling OpenPrinter()
321s191ms925us ERROR: GetNetworkAddress() failed
321s192ms129us ERROR: SnmpChannel::Open() _ioChannel.Init() failed
I’d like to capture this in a variable instead of outputting it to the screen, so I can parse through these errors. I tried redirecting the various output streams to a variable, and setting the variable = the command results, but no luck. Any ideas?