Get-AzResourceGraphQuery

Get a single graph query by its resourceName.

Syntax

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

Description

Get a single graph query by its resourceName.

Examples

Example 1: Get all resource graph queries 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 object

$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 credentials, account, tenant, and subscription used for communication with Azure.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
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:IResourceGraphIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

The name of the Graph Query resource.

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

-ResourceGroupName

The name of the resource group.

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

-SubscriptionId

The Azure subscription Id.

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

Inputs

IResourceGraphIdentity

Outputs

IGraphQueryResource

Notes

ALIASES

COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

INPUTOBJECT <IResourceGraphIdentity>: Identity Parameter

  • [Id <String>]: Resource identity path
  • [ResourceGroupName <String>]: The name of the resource group.
  • [ResourceName <String>]: The name of the Graph Query resource.
  • [SubscriptionId <String>]: The Azure subscription Id.