如何使用 powershell 检索 Azure 通知中心访问策略的端点?

How do I retrieve the endpoint of an Azure Notification Hub Access policy using powershell?

我需要使用 Powershell 以编程方式检索 NotificationHub 访问策略的端点。

我已经尝试 Get-AzNotificationHubsListKey 来自 https://docs.microsoft.com/en-us/powershell/module/az.notificationhubs/get-aznotificationhubauthorizationrule?view=azps-5.4.0:

$ruleKey = Get-AzNotificationHubsListKey `
  -ResourceGroup $resourceGroupName `
  -Namespace $notificationsHubNamespace `
  -NotificationHub $notificationHub `
  -AuthorizationRule $ruleName

但这会引发错误:

Get-AzNotificationHubsListKey: The term 'Get-AzNotificationHubsListKey' is not recognized as a name of a cmdlet, function, script file, or executable program.

谁能帮帮我?

您的命令似乎有错别字。根据docs,应该是Get-AzNotificationHubListKey,而你有Get-AzNotificationHubSListKey.