我有一个PowerShell脚本,调用了一个CmdLet,该CmdLet使用Write-Progress报告其进度,我想隐藏进度条。
是否可以抑制或重定向Write-Progress CmdLet的输出?
我有一个PowerShell脚本,调用了一个CmdLet,该CmdLet使用Write-Progress报告其进度,我想隐藏进度条。
是否可以抑制或重定向Write-Progress CmdLet的输出?
在调用使用Write-Progress的cmdlet之前尝试设置此首选项变量:
$ProgressPreference = 'SilentlyContinue'
您可能希望之后恢复为“继续”状态。
$ProgressPreference
的值吗? - Keith Hill