< Back
Get-AutomateAPIGeneric
Post
NAME Get-AutomateAPIGeneric
SYNOPSIS
Internal function used to make generic API calls
SYNTAX
Get-AutomateAPIGeneric [-PageSize <Int32>] -Page <Int32> -Endpoint <String> [-OrderBy <String>] [-Condition
<String>] [-IncludeFields <String>] [-ExcludeFields <String>] [-IDs <String>] [-Expand <String>]
[<CommonParameters>]
Get-AutomateAPIGeneric [-AllResults] -Endpoint <String> [-OrderBy <String>] [-Condition <String>] [-IncludeFields
<String>] [-ExcludeFields <String>] [-IDs <String>] [-Expand <String>] [<CommonParameters>]
DESCRIPTION
Internal function used to make generic API calls
PARAMETERS
-PageSize <Int32>
The page size of the results that come back from the API - limit this when needed
Required? false
Position? named
Default value 1000
Accept pipeline input? false
Accept wildcard characters? false
-Page <Int32>
Brings back a particular page as defined
Required? true
Position? named
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
-AllResults [<SwitchParameter>]
Will bring back all results for a particular query with no concern for result set size
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Endpoint <String>
The individial URI to post to for results, IE computers?
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-OrderBy <String>
Order by - Used to sort the results by a field. Can be sorted in ascending or descending order.
Example - fieldname asc
Example - fieldname desc
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Condition <String>
Condition - the searches that can be used to search for specific things. Supported operators are '=', 'eq',
'>', '>=', '<', '<=', 'and', 'or', '()', 'like', 'contains', 'in', 'not'.
The 'not' operator is only used with 'in', 'like', or 'contains'. The '=' and 'eq' operator are the same.
String values can be surrounded with either single or double quotes.
Boolean values are specified as 'true' or 'false'. Parenthesis can be used to control the order of operations
and group conditions.
The 'like' operator translates to the MySQL 'like' operator.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-IncludeFields <String>
A comma delimited list of fields, when specified only these fields will be included in the result set
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ExcludeFields <String>
A comma delimited list of fields, when specified these fields will be excluded from the final result set
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-IDs <String>
A comma delimited list of fields, when specified only these IDs will be returned
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Expand <String>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
The returned results from the API call
NOTES
Version: 1.0
Author: Gavin Stone
Creation Date: 20/01/2019
Purpose/Change: Initial script development
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-AutomateAPIGeneric -Page 1 -Condition "RemoteAgentLastContact <= 2019-12-18T00:50:19.575Z" -Endpoint
"computers?"
RELATED LINKS
SYNOPSIS
Internal function used to make generic API calls
SYNTAX
Get-AutomateAPIGeneric [-PageSize <Int32>] -Page <Int32> -Endpoint <String> [-OrderBy <String>] [-Condition
<String>] [-IncludeFields <String>] [-ExcludeFields <String>] [-IDs <String>] [-Expand <String>]
[<CommonParameters>]
Get-AutomateAPIGeneric [-AllResults] -Endpoint <String> [-OrderBy <String>] [-Condition <String>] [-IncludeFields
<String>] [-ExcludeFields <String>] [-IDs <String>] [-Expand <String>] [<CommonParameters>]
DESCRIPTION
Internal function used to make generic API calls
PARAMETERS
-PageSize <Int32>
The page size of the results that come back from the API - limit this when needed
Required? false
Position? named
Default value 1000
Accept pipeline input? false
Accept wildcard characters? false
-Page <Int32>
Brings back a particular page as defined
Required? true
Position? named
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
-AllResults [<SwitchParameter>]
Will bring back all results for a particular query with no concern for result set size
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Endpoint <String>
The individial URI to post to for results, IE computers?
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-OrderBy <String>
Order by - Used to sort the results by a field. Can be sorted in ascending or descending order.
Example - fieldname asc
Example - fieldname desc
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Condition <String>
Condition - the searches that can be used to search for specific things. Supported operators are '=', 'eq',
'>', '>=', '<', '<=', 'and', 'or', '()', 'like', 'contains', 'in', 'not'.
The 'not' operator is only used with 'in', 'like', or 'contains'. The '=' and 'eq' operator are the same.
String values can be surrounded with either single or double quotes.
Boolean values are specified as 'true' or 'false'. Parenthesis can be used to control the order of operations
and group conditions.
The 'like' operator translates to the MySQL 'like' operator.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-IncludeFields <String>
A comma delimited list of fields, when specified only these fields will be included in the result set
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ExcludeFields <String>
A comma delimited list of fields, when specified these fields will be excluded from the final result set
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-IDs <String>
A comma delimited list of fields, when specified only these IDs will be returned
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Expand <String>
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
The returned results from the API call
NOTES
Version: 1.0
Author: Gavin Stone
Creation Date: 20/01/2019
Purpose/Change: Initial script development
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-AutomateAPIGeneric -Page 1 -Condition "RemoteAgentLastContact <= 2019-12-18T00:50:19.575Z" -Endpoint
"computers?"
RELATED LINKS