Show-CafSubscriptionsCost
Displays cost information for all Azure subscriptions in the current tenant.
Syntax
Show-CafSubscriptionsCost
[-EndDate <datetime>]
[-Month <int>]
[-MonthName <string>]
[-StartDate <datetime>]
[-TenantId <string>]
[-TimeFrameInDays <int>]
[-Year <int>]
[-IncludeDisabled]
Description
Retrieves all Azure subscriptions, calculates their cost for the specified period, and displays the results in a table format along with a tenant-wide total. The time period can be specified as a number of days, a named month and year, or explicit start and end dates. If no period is given, the command defaults to the previous month.
Note
This command requires the Az.CostManagement module. It will be installed automatically if not present.
Example
Show-CafSubscriptionsCost -TimeFrameInDays 30
Parameter
-EndDate The end date of the cost reporting period.
| Property | Value |
|---|---|
| Type: | datetime |
| Default value: | None |
| Required: | False |
-Month
The month number (1–12) for the cost reporting period. Used together with -Year.
| Property | Value |
|---|---|
| Type: | int |
| Default value: | None |
| Required: | False |
-MonthName
The English name of the month for the cost reporting period (e.g., "March"). Used together with -Year.
| Property | Value |
|---|---|
| Type: | string |
| Default value: | None |
| Required: | False |
-StartDate The start date of the cost reporting period.
| Property | Value |
|---|---|
| Type: | datetime |
| Default value: | None |
| Required: | False |
-TenantId The ID of the Azure tenant to analyze. If not provided, the tenant is resolved from the CAF context or the current Azure context.
| Property | Value |
|---|---|
| Type: | string |
| Default value: | None |
| Required: | False |
-TimeFrameInDays The number of days to include in the cost calculation, counting back from today.
| Property | Value |
|---|---|
| Type: | int |
| Default value: | None |
| Required: | False |
-Year
The year for the cost reporting period. Used together with -Month or -MonthName.
| Property | Value |
|---|---|
| Type: | int |
| Default value: | None |
| Required: | False |
-IncludeDisabled
If specified, includes disabled subscriptions in the results.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Default value: | False |
| Required: | False |