Skip to content

Instantly share code, notes, and snippets.

View Selena20191's full-sized avatar
💭
I may be slow to respond.

Selena20191

💭
I may be slow to respond.
View GitHub Profile
@bmoore-msft
bmoore-msft / Verify-DeploymentGuid.ps1
Last active March 22, 2022 19:20
Fetch the resources tagged in a pid-[GUID] deployment
Param(
[string][Parameter(Mandatory=$true)]$deploymentName, # the full name of the deployment, e.g. pid-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
[string][Parameter(Mandatory=$true)]$resourceGroupName
)
# Get the correlationId of the named deployment
$correlationId = (Get-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -Name "$deploymentName").correlationId
# Find all deployments with that correlationId
$deployments = Get-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName | Where-Object{$_.correlationId -eq $correlationId}