从“Get-AzureRmEventHubKey”命令power-shell中提取事件中心Microsoft-azure的主键

问题描述 投票:2回答:1

我想从“Get-AzureRmEventHubKey”的输出中获取主键并将其存储在变量中,如何通过PowerShell执行此操作?

azure azure-powershell azure-eventhub
1个回答
1
投票

您可以尝试使用以下PowerShell cmdlet从even-hub中提取主键:

$PrimaryKey = Get-AzureRmEventHubKey -ResourceGroupName myResourceGroup -NamespaceName namespace_name -Name RootManageSharedAccessKey |Select -ExpandProperty "PrimaryKey"
© www.soinside.com 2019 - 2024. All rights reserved.