简体   繁体   English

PowerShell:抑制Write-Progress输出

[英]PowerShell: suppress Write-Progress output

I have a PowerShell script that calls a CmdLet which in turn reports its progress using Write-Progress, and I would like to hide the progress bar. 我有一个PowerShell脚本调用CmdLet,后者使用Write-Progress报告其进度,我想隐藏进度条。
In is it possible to suppress or redirect the output of the Write-Progress CmdLet? In是否可以抑制或重定向Write-Progress CmdLet的输出?

Try setting this preference variable before calling the cmdlet that utilizes Write-Progress: 尝试在调用使用Write-Progress的cmdlet之前设置此首选项变量:

$ProgressPreference = 'SilentlyContinue'

You may want to revert back to 'Continue' afterwards. 您可能希望之后恢复为“继续”。

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

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