Skip to content

Commit 8e9fc9c

Browse files
Quality changes
Fixed position of -Fields parameter by request. Correctly hooked up the -Fields parameter in several functions.
1 parent 1736ccf commit 8e9fc9c

File tree

5 files changed

+25
-21
lines changed

5 files changed

+25
-21
lines changed

ServiceNow/Public/Get-ServiceNowChangeRequest.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ function Get-ServiceNowChangeRequest {
22
[OutputType([System.Management.Automation.PSCustomObject])]
33
[CmdletBinding(DefaultParameterSetName)]
44
Param(
5-
# Fields to return
6-
[parameter(mandatory = $false)]
7-
[string[]]$Fields,
8-
95
# Machine name of the field to order by
106
[Parameter(Mandatory = $false)]
117
[string]$OrderBy = 'opened_at',
@@ -19,6 +15,10 @@ function Get-ServiceNowChangeRequest {
1915
[Parameter(Mandatory = $false)]
2016
[int]$Limit = 10,
2117

18+
# Fields to return
19+
[parameter(mandatory = $false)]
20+
[string[]]$Fields,
21+
2222
# Hashtable containing machine field names and values returned must match exactly (will be combined with AND)
2323
[Parameter(Mandatory = $false)]
2424
[hashtable]$MatchExact = @{},
@@ -60,7 +60,8 @@ function Get-ServiceNowChangeRequest {
6060
$getServiceNowTableSplat = @{
6161
Table = 'change_request'
6262
Query = $Query
63-
Limit = $Limit
63+
Limit = $
64+
Fields = $Fields
6465
DisplayValues = $DisplayValues
6566
}
6667

ServiceNow/Public/Get-ServiceNowConfigurationItem.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ function Get-ServiceNowConfigurationItem {
22
[OutputType([System.Management.Automation.PSCustomObject])]
33
[CmdletBinding(DefaultParameterSetName)]
44
Param(
5-
# Fields to return
6-
[parameter(mandatory = $false)]
7-
[string[]]$Fields,
8-
95
# Machine name of the field to order by
106
[Parameter(Mandatory = $false)]
117
[string]$OrderBy = 'name',
@@ -19,6 +15,10 @@ function Get-ServiceNowConfigurationItem {
1915
[Parameter(Mandatory = $false)]
2016
[int]$Limit = 10,
2117

18+
# Fields to return
19+
[parameter(mandatory = $false)]
20+
[string[]]$Fields,
21+
2222
# Hashtable containing machine field names and values returned must match exactly (will be combined with AND)
2323
[Parameter(Mandatory = $false)]
2424
[hashtable]$MatchExact = @{},
@@ -61,6 +61,7 @@ function Get-ServiceNowConfigurationItem {
6161
Table = 'cmdb_ci'
6262
Query = $Query
6363
Limit = $Limit
64+
Fields = $Fields
6465
DisplayValues = $DisplayValues
6566
}
6667

ServiceNow/Public/Get-ServiceNowIncident.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ function Get-ServiceNowIncident{
22
[OutputType([System.Management.Automation.PSCustomObject])]
33
[CmdletBinding(DefaultParameterSetName)]
44
Param(
5-
# Fields to return
6-
[parameter(mandatory = $false)]
7-
[string[]]$Fields,
8-
95
# Machine name of the field to order by
106
[Parameter(Mandatory = $false)]
117
[string]$OrderBy = 'opened_at',
@@ -19,6 +15,10 @@ function Get-ServiceNowIncident{
1915
[Parameter(Mandatory = $false)]
2016
[int]$Limit = 10,
2117

18+
# Fields to return
19+
[parameter(mandatory = $false)]
20+
[string[]]$Fields,
21+
2222
# Hashtable containing machine field names and values returned must match exactly (will be combined with AND)
2323
[Parameter(Mandatory = $false)]
2424
[hashtable]$MatchExact = @{},
@@ -61,6 +61,7 @@ function Get-ServiceNowIncident{
6161
Table = 'incident'
6262
Query = $Query
6363
Limit = $Limit
64+
Fields = $Fields
6465
DisplayValues = $DisplayValues
6566
}
6667

ServiceNow/Public/Get-ServiceNowRequest.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ function Get-ServiceNowRequest {
22
[OutputType([System.Management.Automation.PSCustomObject])]
33
[CmdletBinding(DefaultParameterSetName)]
44
Param(
5-
# Fields to return
6-
[parameter(mandatory = $false)]
7-
[string[]]$Fields,
8-
95
# Machine name of the field to order by
106
[Parameter(Mandatory = $false)]
117
[string]$OrderBy = 'opened_at',
@@ -19,6 +15,10 @@ function Get-ServiceNowRequest {
1915
[Parameter(Mandatory = $false)]
2016
[int]$Limit = 10,
2117

18+
# Fields to return
19+
[parameter(mandatory = $false)]
20+
[string[]]$Fields,
21+
2222
# Hashtable containing machine field names and values returned must match exactly (will be combined with AND)
2323
[Parameter(Mandatory = $false)]
2424
[hashtable]$MatchExact = @{},
@@ -61,6 +61,7 @@ function Get-ServiceNowRequest {
6161
Table = 'sc_request'
6262
Query = $Query
6363
Limit = $Limit
64+
Fields = $Fields
6465
DisplayValues = $DisplayValues
6566
}
6667

ServiceNow/Public/Get-ServiceNowRequestItem.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ function Get-ServiceNowRequestItem {
1818
[OutputType([System.Management.Automation.PSCustomObject])]
1919
[CmdletBinding(DefaultParameterSetName)]
2020
param(
21-
# Fields to return
22-
[parameter(mandatory = $false)]
23-
[string[]]$Fields,
24-
2521
# Machine name of the field to order by
2622
[parameter(Mandatory = $false)]
2723
[string]$OrderBy = 'opened_at',
@@ -35,6 +31,10 @@ function Get-ServiceNowRequestItem {
3531
[parameter(Mandatory = $false)]
3632
[int]$Limit = 10,
3733

34+
# Fields to return
35+
[parameter(mandatory = $false)]
36+
[string[]]$Fields,
37+
3838
# Hashtable containing machine field names and values returned must match exactly (will be combined with AND)
3939
[parameter(Mandatory = $false)]
4040
[hashtable]$MatchExact = @{},

0 commit comments

Comments
 (0)