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

Get-AzureRmDeploymentManagerServiceUnit

获取服务单元。

语法

Get-AzureRmDeploymentManagerServiceUnit
   [-ResourceGroupName] <String>
   [-ServiceTopologyName] <String>
   [-ServiceName] <String>
   [-Name] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmDeploymentManagerServiceUnit
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-Service] <PSServiceResource>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmDeploymentManagerServiceUnit
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-ServiceResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmDeploymentManagerServiceUnit
   [-ResourceGroupName] <String>
   [-ServiceName] <String>
   [-Name] <String>
   [-ServiceTopology] <PSServiceTopologyResource>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmDeploymentManagerServiceUnit
   [-ResourceGroupName] <String>
   [-ServiceName] <String>
   [-Name] <String>
   [-ServiceTopologyResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmDeploymentManagerServiceUnit
   [-ResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmDeploymentManagerServiceUnit
   [-ServiceUnit] <PSServiceUnitResource>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

说明

Get-AzureRmDeploymentManagerServiceUnit cmdlet 获取服务中的服务单元。

按服务单元的名称、定义的服务、服务拓扑名称和资源组名称指定服务单元。 或者,可以提供 ServiceUnit 对象或 ResourceId。

可以在本地修改此对象,然后使用 Set-AzureRmDeploymentManagerServiceUnit cmdlet 将更改应用到服务单元。

示例

示例 1

PS C:\> Get-AzureRmDeploymentManagerServiceUnit -ResourceGroupName ContosoResourceGroup -ServiceTopologyName ContosoServiceTopology -ServiceName ContosoService1  -Name ContosoService1Storage

此命令在 ContosoResourceGroup 中名为 ContosoServiceTopology 的服务拓扑中的服务拓扑中获取名为 ContosoService1Storage 的服务单元。

示例 2:使用资源标识符获取服务单元。

PS C:\> Get-AzureRmDeploymentManagerServiceUnit -ResourceId "/subscriptions/subscriptionId/resourcegroups/ContosoResourceGroup/providers/Microsoft.DeploymentManager/serviceTopologies/ContosoServiceTopology/services/ContosoService1/serviceUnits/ContosoService1Storage"

此命令在 ContosoResourceGroup 中名为 ContosoServiceTopology 的服务拓扑中的服务拓扑中获取名为 ContosoService1Storage 的服务单元。

示例 3:使用服务单元对象获取服务单元。

PS C:\> Get-AzureRmDeploymentManagerServiceUnit -ServiceUnit $serviceUnitObject

此命令获取一个服务单元,其名称、服务名称、服务拓扑名称和 ResourceGroup 分别与$serviceUnitObject的名称、ServiceName、ServiceTopologyName 和 ResourceGroupName 属性匹配。

参数

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

服务单元的名称。

Type:String
Position:3
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

资源组。

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceId

资源标识符。

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Service

应在其中创建服务单元的服务对象。

Type:PSServiceResource
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServiceName

服务单元所属的服务的名称。

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ServiceResourceId

应在其中创建服务单元的服务资源标识符。

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServiceTopology

应在其中创建服务单元的服务拓扑对象。

Type:PSServiceTopologyResource
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServiceTopologyName

服务单元所属的服务拓扑的名称。

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ServiceTopologyResourceId

应在其中创建服务单元的服务拓扑资源标识符。

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServiceUnit

服务单元资源对象。

Type:PSServiceUnitResource
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

输入

None

输出

PSServiceUnitResource