Skip to content

Invoke ePOQuery

Michael Arranaga edited this page Aug 30, 2019 · 1 revision

external help file: ePOwerShell-help.xml Module Name: ePOwerShell online version: schema: 2.0.0

Invoke-ePOQuery

SYNOPSIS

Either runs a predefined query or a custom query against the ePO server

SYNTAX

PremadeQuery

Invoke-ePOQuery [-Query] <Object> [-Database <String>] [<CommonParameters>]

CustomQuery

Invoke-ePOQuery -Table <String> -Select <String[]> -Where <Hashtable> [-Database <String>] [<CommonParameters>]

DESCRIPTION

Based off the Query Name or ID, runs the query and returns the output.

EXAMPLES

EXAMPLE 1

$Query = Get-ePOQuery

$Query = $Query | Where-Object { $_.Name -eq 'My Awesome Query' } $Results = Invoke-ePOQuery -Query $Query

Run a predefined query saved on the ePO server

PARAMETERS

-Query

Specifies a predefined query that is stored on the ePO server. Can be provided by:

* An ePOQuery object
* A query ID
* A query Name

This parameter can be passed in from the pipeline.

Type: Object
Parameter Sets: PremadeQuery
Aliases:

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

-Table

Specifies the table on the ePO server you would like to query against. Run Get-ePOTable to see available tables and values.

Type: String
Parameter Sets: CustomQuery
Aliases:

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

-Select

Specifies the items from tables you're specifically looking for. If a table name is not specified in your select string, then `$Table` is prepended to the beginning of your select item.

Type: String[]
Parameter Sets: CustomQuery
Aliases:

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

-Where

A hashtable used to limit the query to items meeting only specific criteria

Type: Hashtable
Parameter Sets: CustomQuery
Aliases:

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

-Database

Optional parameter. Specifies a separate database to query, other than the default one.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
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

OUTPUTS

[System.Object[]]

NOTES

RELATED LINKS

Clone this wiki locally