Open
Description
Description of the new feature
The ARM API supports $expand=createdTime,changedTime
, both for GET and LIST for resource groups:
- Get: https://learn.microsoft.com/en-us/rest/api/resources/resource-groups/get
- List: https://learn.microsoft.com/en-us/rest/api/resources/resource-groups/list
It'd be useful if Get-AzResourceGroup
included this info, at least optionally. No possibility of that today:
Today one can do this:
# GET
ConvertFrom-Json -InputObject (
(Invoke-AzRestMethod -Method 'Get' -Path (
'{0}?$expand=createdTime,changedTime&api-version=2021-04-01' -f
$ResourceGroupId
)
).'Content'
# LIST
(
ConvertFrom-Json -InputObject (
Invoke-AzRestMethod -Method 'Get' -Path (
'/subscriptions/resourceGroups?$expand=createdTime,changedTime&api-version=2021-04-01' -f
$SubscriptionId
)
).'Content'
).'value'
Proposed implementation details (optional)
Either:
- Include by default.
- Option to include said info.
- Add
-Expand someProperty,someOtherProperty
option which translates to$expand=someProperty,someOtherProperty
?- It's not that these change often, so can be hardcoded and checked before going to the ARM API?
"ERROR: "someProperty" is not a property that can be expanded on ResourceGroup
.
- It's not that these change often, so can be hardcoded and checked before going to the ARM API?
-IncludeTimeInfo
switch?
- Add