有没有办法在powershell中隐藏输出?

有没有办法在powershell中隐藏输出?,powershell,Powershell,我想保留下面的所有代码,但我只想输出应用程序名?我需要在输出中有where语句。是否可以隐藏“APPLICATION NAME:$”之后的任何内容的输出,以便我看不到$Requirement的输出 Write-output "APPLICATION NAME: $_ `r`n Requirement: $Requirement " | Where { $_ -notlike "*All_x64_Windows_10_and_higher_Clients*" }; 我不熟悉PS,但有一点搜索小

我想保留下面的所有代码,但我只想输出应用程序名?我需要在输出中有where语句。是否可以隐藏“APPLICATION NAME:$”之后的任何内容的输出,以便我看不到$Requirement的输出

Write-output "APPLICATION NAME: $_ `r`n Requirement: $Requirement " | Where { $_ -notlike "*All_x64_Windows_10_and_higher_Clients*" }; 

我不熟悉PS,但有一点搜索小提琴这是我想出的

写入输出(“应用程序名称:$\`r`n Requirement:$Requirement”|其中{$\-notlike“All_x64_Windows_10_和_higher_Clients”).split(`r`n)[0]

您的意思是“需要在输出中包含Where语句”?是否希望文字语句作为字符串?