Skip to content

Latest commit

 

History

History
170 lines (130 loc) · 4 KB

Get-AzResourceGraphQuery.md

File metadata and controls

170 lines (130 loc) · 4 KB
external help file Module Name online version schema
Az.ResourceGraph-help.xml
Az.ResourceGraph
2.0.0

Get-AzResourceGraphQuery

SYNOPSIS

Get a single graph query by its resourceName.

SYNTAX

List (Default)

Get-AzResourceGraphQuery -ResourceGroupName <String> [-SubscriptionId <String[]>] [-DefaultProfile <PSObject>]
 [<CommonParameters>]

Get

Get-AzResourceGraphQuery -Name <String> -ResourceGroupName <String> [-SubscriptionId <String[]>]
 [-DefaultProfile <PSObject>] [<CommonParameters>]

GetViaIdentity

Get-AzResourceGraphQuery -InputObject <IResourceGraphIdentity> [-DefaultProfile <PSObject>]
 [<CommonParameters>]

DESCRIPTION

Get a single graph query by its resourceName.

EXAMPLES

Example 1: Get all resource graph query under a resource group

Get-AzResourceGraphQuery -ResourceGroupName azure-rg-test
Location Name            Type
-------- ----            ----
global   SharedQuery-t01 microsoft.resourcegraph/queries

This command gets all resource graph query under a resource group.

Example 2: Get a resource graph query by name

Get-AzResourceGraphQuery -ResourceGroupName azure-rg-test -Name SharedQuery-t01
Location Name            Type
-------- ----            ----
global   SharedQuery-t01 microsoft.resourcegraph/queries

This command gets a resource graph query by name.

Example 3: Get a resource graph query by objecy

$query = New-AzResourceGraphQuery -ResourceGroupName azure-rg-test -Name query-t03 -Location 'global' -Query 'project id, name, type, location' -Description 'test'
Get-AzResourceGraphQuery -InputObject $query
Location Name            Type
-------- ----            ----
global   SharedQuery-t01 microsoft.resourcegraph/queries

This command gets a resource graph query by object.

PARAMETERS

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type: System.Management.Automation.PSObject
Parameter Sets: (All)
Aliases: AzureRMContext, AzureCredential

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

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type: Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.IResourceGraphIdentity
Parameter Sets: GetViaIdentity
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Name

The name of the Graph Query resource.

Type: System.String
Parameter Sets: Get
Aliases:

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

-ResourceGroupName

The name of the resource group.

Type: System.String
Parameter Sets: List, Get
Aliases:

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

-SubscriptionId

The Azure subscription Id.

Type: System.String[]
Parameter Sets: List, Get
Aliases:

Required: False
Position: Named
Default value: (Get-AzContext).Subscription.Id
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.IResourceGraphIdentity

OUTPUTS

Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.IGraphQueryResource

NOTES

RELATED LINKS