使用 Azure Powershell 获取当前服务计划下部署的站点数

Get number of sites deployed under current service plan with Azure Powershell

我正在尝试显示在当前服务计划下部署的 webApps/Sites 的数量。这是我到目前为止所拥有的,但似乎无法正常工作。任何指导将不胜感激。

$q = Get-AzureRmAppServicePlan | Get-Member -name NumberOfSites 
Write-Host $q

您输入了正确的 cmdlet,但管道命令是错误的。 Get-Member 将讲述特定对象的方法和属性。所以你将无法从中获取任何值。

试试这个:

$result = Get-AzureRmAppServicePlan | Select-Object -ExpandProperty NumberOfSites
Write-host $result

希望对您有所帮助。