powershell - %{ $_.Key1 } 是什么意思?

标签 powershell azure-hdinsight

在为 HDInsight 编程时,我遇到了像

$storageAccountKey = Get-AzureRmStorageAccountKey 
    -ResourceGroupName $resourceGroupName 
    -Name $storageAccountName 
    |  %{ $_.Key1 }

我明白 $_指的是 Get-AzureRmStorageAccountKey 的结果命令。但是%{}究竟是什么意思? ?

最佳答案

%{ $_.Key1 }ForEach-Object { Write-Output $_.Key1 } ⇔ 对于管道中的每个对象,回显其属性的值 Key1 .
%alias ForEach-Object . $_是当前对象 automatic variable .

关于powershell - %{ $_.Key1 } 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35272003/

相关文章:

powershell - 使用Powershell和ADSI设置本地密码

powershell - 在 PowerShell 和 Server 2012 R2 中使用 Get-TlsCipherSuite

Powershell 和 TFS : tf. exe 与 Power tools TFS cmdlet?

hadoop - 不使用TRIM功能,是否可以使用SQOOP导入的表?

hadoop - 此Hive查询创建外部表有什么问题?

java - 通过 CMD 与 Powershell 执行 Java 命令时的差异 - 由句点 ("."引起)

powershell - 什么是文件系统提供程序过滤器语法?

python - 如何在azure hdinsight pyspark3内核上安装python包?

azure - 错误代码: JA018 whie runnnig oozie workflow in HDInsight spark2 cluster

java - 从 Spark Java 应用程序登录 Azure