編集

次の方法で共有


New-AzCostManagementQueryFilterObject

Create a in-memory object for QueryFilter

Syntax

New-AzCostManagementQueryFilterObject
   [-And <IQueryFilter[]>]
   [-Dimensions <IQueryComparisonExpression>]
   [-Not <IQueryFilter>]
   [-Or <IQueryFilter[]>]
   [-Tag <IQueryComparisonExpression>]
   [<CommonParameters>]

Description

Create a in-memory object for QueryFilter

Examples

Example 1: Create a filter object of query for cost management export

$orDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Value @('East US', 'West Europe')
$orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Value @('UAT', 'Prod')
New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimensions $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag))

And       :
Dimension : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpression
Not       : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilter
Or        : {Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryFilter}
Tag       : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20211001.QueryComparisonExpression

this command creates a filter object of query for cost management export.

Parameters

-And

The logical "AND" expression. Must have at least 2 items. To construct, see NOTES section for AND properties and create a hash table.

Type:IQueryFilter[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Dimensions

Has comparison expression for a dimensions. To construct, see NOTES section for DIMENSIONS properties and create a hash table.

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

-Not

The logical "NOT" expression. To construct, see NOTES section for NOT properties and create a hash table.

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

-Or

The logical "OR" expression. Must have at least 2 items. To construct, see NOTES section for OR properties and create a hash table.

Type:IQueryFilter[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Tag

Has comparison expression for a tag. To construct, see NOTES section for TAG properties and create a hash table.

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

Outputs

QueryFilter