Fra*_*ald 11 powershell hdinsight
在为HDInsight编程时,我遇到了类似的行
$storageAccountKey = Get-AzureRmStorageAccountKey
-ResourceGroupName $resourceGroupName
-Name $storageAccountName
| %{ $_.Key1 }
Run Code Online (Sandbox Code Playgroud)
我理解$_
是指Get-AzureRmStorageAccountKey
命令的结果.但究竟是什么意思%{}
?
Ans*_*ers 25
%{ $_.Key1 }
⇔⇔ ForEach-Object { Write-Output $_.Key1 }
管道中的每个对象,回显其属性的值Key1
.
%
是一个别名为ForEach-Object
.$_
是当前对象的自动变量.
归档时间: |
|
查看次数: |
8226 次 |
最近记录: |