powershell - PowerShell 短语 "| ? {...}"是什么意思?

标签 powershell

PowerShell 有一些语法特性,我找不到太多相关文档。今天我的问题是 ? {...}

例子

PS> Get-SPServiceInstance | ? {$_.GetType.toString() -eq $varname}

我明白管道的意思了。我很确定 $_ 用于在某种循环中引用当前项目。

谁能解释一下这是什么意思?另外,如果有人能指出我可以找到有关 PowerShell 保留符号的地方,那就太好了。

最佳答案

[^_^]16:46:21[1]>get-help ?

Name                              Category  Synopsis
----                              --------  --------
%                                 Alias     ForEach-Object
?                                 Alias     Where-Object
h                                 Alias     Get-History
r                                 Alias     Invoke-History

“?”是“where-object”的别名

关于powershell - PowerShell 短语 "| ? {...}"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11460352/

相关文章:

sql-server - 使用 powershell 部署带有变量替换的 dacpac

sharepoint - 从自定义 C# cmdlet 中创建新的 RunSpace 是一种不好的做法吗?

azure - Powershell AzureADPreview cmdlet Set-AzureADApplication "PreAuthorizedApplications"参数的正确语法是什么?

powershell - 如果禁止使用标准位置,则将PowerShell配置文件脚本放在哪里?

json - 仅从json中删除/排除属性(如果存在)

email - 使用Powershell发送延迟消息传递并更改默认帐户

windows - 我可以在不使用密码的情况下检查加密的 zip 存档的内容吗?

powershell - 如何更改由 hashstables Powershell 形成的输出

powershell - 无法使用 powershell 启动 azure 数据库的无人值守导入

windows - 我可以以编程方式访问 RSA 软 token 密码吗