简体   繁体   English

在powershell中将文件打印到特定打印机?

[英]Print file to specific printer in powershell?

So Im creating a file and sending to print to a printer called UNBILLING, but for some weird reason the command will use the default printer instead of the one mentioned.因此,我创建了一个文件并发送到名为 UNBILLING 的打印机进行打印,但出于某种奇怪的原因,该命令将使用默认打印机而不是提到的打印机。 Why?为什么?

Here is the code I use这是我使用的代码

 start-process -filepath "$root\UNB\FINAL_TEXTO\$archivo" -verb print | out-printer "UNBILLING" 

Any help is appreciated.任何帮助表示赞赏。

这会将文件的内容发送到打印机并确保打印机已实际安装。

Get-Content -Path "$root\UNB\FINAL_TEXTO\$archivo" | Out-Printer -Name (Get-Printer | Where-Object {$_.Name -like "UNBILLING"}.Name

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM