File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ function Get-ServiceNowTable {
3535 [parameter (ParameterSetName = ' SetGlobalAuth' )]
3636 [int ]$Limit = 10 ,
3737
38+ # Fields to return
39+ [parameter (mandatory = $false )]
40+ [parameter (ParameterSetName = ' SpecifyConnectionFields' )]
41+ [parameter (ParameterSetName = ' UseConnectionObject' )]
42+ [parameter (ParameterSetName = ' SetGlobalAuth' )]
43+ [string []]$Fields ,
44+
3845 # Whether or not to show human readable display values instead of machine values
3946 [parameter (ParameterSetName = ' SpecifyConnectionFields' )]
4047 [parameter (ParameterSetName = ' UseConnectionObject' )]
@@ -84,6 +91,10 @@ function Get-ServiceNowTable {
8491 $Body.sysparm_query = $Query
8592 }
8693
94+ if ($Fields ) {
95+ $Body.sysparm_fields = $Fields -join ' ,'
96+ }
97+
8798 # Perform table query and capture results
8899 $Uri = $ServiceNowURL + " /table/$Table "
89100 $Result = (Invoke-RestMethod - Uri $Uri - Credential $ServiceNowCredential - Body $Body - ContentType " application/json" ).Result
You can’t perform that action at this time.
0 commit comments