Edit

Share via


Get-AzHostGroup

Get or list hosts.

Syntax

DefaultParameter (Default)

Get-AzHostGroup
    [[-ResourceGroupName] <String>]
    [[-Name] <String>]
    [-InstanceView]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

ResourceIdParameter

Get-AzHostGroup
    [-ResourceId] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

This cmdlet will get a host group. This cmdlet also lists all host groups in a resource group if a host group name is not given. This cmdlet also lists all host groups in a subscription if neither host group name nor resource group name is given.

Examples

Example 1

Get-AzHostGroup -ResourceGroupName $resourceGroupName -HostGroupName $hostGroupName
ResourceGroupName        : myrg01
PlatformFaultDomainCount : 2
Hosts                    : {/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg01/providers/Microsoft.Compute/hostGroups/myhostgroup01/hosts/myhost01}
Zones                    : {1}
Id                       : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg01/providers/Microsoft.Compute/hostGroups/myhostgroup01
Name                     : myhostgroup01
Location                 : eastus
Tags                     : {[key1, val1]}

This command returns a host group.

Example 2

Get-AzHostGroup -ResourceGroupName $resourceGroupName
ResourceGroupName                   Name Location           Tags FDCount
-----------------                   ---- --------           ---- -------
myrg01                     myhostgroup01   eastus {[key1, val1]}       1
myrg01                     myhostgroup02   eastus {[key1, val1]}       2

This command returns all host groups in the given resource group.

Example 3

Get-AzHostGroup
ResourceGroupName                   Name Location           Tags FDCount
-----------------                   ---- --------           ---- -------
myrg01                     myhostgroup01   eastus {[key1, val1]}       1
myrg01                     myhostgroup02   eastus {[key1, val1]}       2
myrg02                     myhostgroup03   eastus {[key1, val1]}       2

This command returns all host groups in the subscription.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InstanceView

Expand the returned object to also list the host's instance views.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

DefaultParameter
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The name of the host group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:HostGroupName

Parameter sets

DefaultParameter
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceGroupName

The name of the resource group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

DefaultParameter
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceId

The ID of the resource.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ResourceIdParameter
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

PSHostGroup