In Azure CLI, I can use az deployment sub validate to get detailed output about all the resources in a subscription-level deployment template:
{
"error": null,
"id": "/subscriptions/.../providers/Microsoft.Resources/deployments/main",
"location": "westeurope",
"name": "main",
"properties": {
...
"validatedResources": [
{
"id": "/subscriptions/.../resourceGroups/my-rg"
},
{
"id": "/subscriptions/.../resourceGroups/my-rg/providers/Microsoft.Resources/deployments/logAnalyticsWorkspace",
"resourceGroup": "my-rg"
},
{
"id": "/subscriptions/.../resourceGroups/my-rg/providers/Microsoft.Resources/deployments/identity",
"resourceGroup": "my-rg"
},
...
]
},
"type": "Microsoft.Resources/deployments"
}
The Azure PowerShell equivalent of az deployment sub validate is Test-AzSubscriptionDeployment, but that returns only errors (if any), no list of resource IDs.
How can I get a similar list of resource IDs for the resources defined by a template using Azure PowerShell?