你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Get-AzureWebHostingPlan

获取当前订阅中的 Azure Web 托管计划。

注意

本文档中引用的 cmdlet 用于管理使用 Azure Service Manager (ASM) API 的旧式 Azure 资源。 创建新资源时,建议不要使用旧的 PowerShell 模块,因为计划将停用 ASM。 有关详细信息,请参阅 Azure Service Manager 停用

Az PowerShell 模块是建议用于管理 PowerShell 的 Azure 资源管理器 (ARM) 资源的 PowerShell 模块。

语法

Get-AzureWebHostingPlan
   [-WebSpaceName <String>]
   [-Name <String>]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

说明

本主题介绍 Microsoft Azure PowerShell 模块的 0.8.10 版本中的 cmdlet。 若要获取正在使用的模块版本,请在 Azure PowerShell 控制台中键入 (Get-Module -Name Azure).Version

Get-AzureWebHostingPlan cmdlet 获取当前订阅中的 Azure Web 托管计划。

默认情况下, Get-AzureWebHostingPlan 获取当前订阅中的所有 Azure 托管计划,并返回一个对象,该对象提供有关计划的基本信息。 使用 WebSpaceName 参数时, Get-AzureWebHostingPlan 将返回特定的托管计划对象。

若要查找当前订阅,请使用 Get-AzureSubscription cmdlet 的 Current 参数。 若要更改当前订阅,请使用 Select-AzureSubscription cmdlet。

示例

示例 1:获取订阅中的所有 Web 托管计划

PS C:\> Get-AzureWebHostingPlan 

Name : Default1 
SKU : Basic 
WorkerSize : Small 
NumberOfWorkers : 1 
CurrentWorkerSize : Small 
CurrentNumberOfWorkers : 1 
Status : Ready 
WebSpace : eastuswebspace 
Name : Default0 
SKU : Free 
WorkerSize : Small 
NumberOfWorkers : 0 
CurrentWorkerSize : Small 
CurrentNumberOfWorkers : 0 
Status : Ready

此命令获取当前订阅中的所有 Azure Web 托管计划。

示例 2:获取订阅中的特定 Web 托管计划

PS C:\> Get-AzureWebHostingPlan -WebSpaceName "westeuropewebspace" -Name "Default0" 

Name : Default0 
SKU : Free 
WorkerSize : Small 
NumberOfWorkers : 0 
CurrentWorkerSize : Small 
CurrentNumberOfWorkers : 0 
Status : Ready 
WebSpace : westeuropewebspace

此命令获取当前订阅中名为 westeuropewebspace 的 Web 空间中名为 Default0 的 Web 托管计划。

参数

-Name

指定订阅中计划的名称。 默认情况下,此 cmdlet 获取当前订阅中的所有计划。 此参数不支持通配符。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-Profile

指定此 cmdlet 从中读取的 Azure 配置文件。 如果未指定配置文件,此 cmdlet 将从本地默认配置文件中读取。

类型:AzureSMProfile
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-WebSpaceName

指定订阅中 Web 空间的名称。 默认情况下,此 cmdlet 获取指定 Web 空间中的所有网站。 此参数不支持通配符。

类型:String
别名:WebSpace
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

输入

可以通过属性名称而不是值将输入传递给此 cmdlet。

输出

Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.WebHostingPlan

默认情况下,Get-AzureWebHostingPlan 返回 WebHostingPlan 对象的数组