Get-AzManagementGroupDeployment

Get deployment at a management group

Syntax

Get-AzManagementGroupDeployment
   [-ManagementGroupId] <String>
   [[-Name] <String>]
   [-ApiVersion <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzManagementGroupDeployment
   -Id <String>
   [-ApiVersion <String>]
   [-Pre]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzManagementGroupDeployment cmdlet gets the deployments at the a management group. Specify the Name or Id parameter to filter the results. By default, Get-AzManagementGroupDeployment gets all deployments at the management group.

Examples

Example 1: Get all deployments at a management group

PS C:\>Get-AzManagementGroupDeployment -ManagementGroupId "myMG"

This command gets all deployments at the management group "myMG".

Example 2: Get a deployment by name

PS C:\>Get-AzDeployment -ManagementGroupId "myMG" -Name "Deploy01"

This command gets the "Deploy01" deployment at the management group "myMG". You can assign a name to a deployment when you create it by using the New-AzManagementGroupDeployment cmdlets. If you do not assign a name, the cmdlets provide a default name based on the template that is used to create the deployment.

Example 3: Get a deployment by ID

PS C:\>Get-AzDeployment -Id "/providers/Microsoft.Management/managementGroups/myMG/providers/Microsoft.Resources/deployments/Deploy01"

This command gets the "Deploy01" deployment at the management group "myMG".

Parameters

-ApiVersion

When set, indicates the version of the resource provider API to use. If not specified, the API version is automatically determined as the latest available.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

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

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

The fully qualified resource Id of the deployment. example: /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deployments/{deploymentName}

Type:String
Aliases:DeploymentId, ResourceId
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ManagementGroupId

The management group id.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

The name of deployment.

Type:String
Aliases:DeploymentName
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Pre

When set, indicates that the cmdlet should use pre-release API versions when automatically determining which version to use.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Microsoft.Azure.Commands.ResourceManager.Cmdlets.SdkModels.PSDeployment