@@ -16,7 +16,7 @@ function Get-ServiceNowUserGroup{
1616 [int ]$Limit = 10 ,
1717
1818 # Fields to return
19- [parameter ( mandatory = $false )]
19+ [Parameter ( Mandatory = $false )]
2020 [string []]$Fields ,
2121
2222 # Hashtable containing machine field names and values returned must match exactly (will be combined with AND)
@@ -49,31 +49,29 @@ function Get-ServiceNowUserGroup{
4949
5050 # Query Splat
5151 $newServiceNowQuerySplat = @ {
52- OrderBy = $OrderBy
52+ OrderBy = $OrderBy
5353 OrderDirection = $OrderDirection
54- MatchExact = $MatchExact
55- MatchContains = $MatchContains
54+ MatchExact = $MatchExact
55+ MatchContains = $MatchContains
5656 }
5757 $Query = New-ServiceNowQuery @newServiceNowQuerySplat
5858
5959 # Table Splat
6060 $getServiceNowTableSplat = @ {
61- Table = ' sys_user_group'
62- Query = $Query
63- Limit = $Limit
64- Fields = $Fields
61+ Table = ' sys_user_group'
62+ Query = $Query
63+ Limit = $Limit
64+ Fields = $Fields
6565 DisplayValues = $DisplayValues
6666 }
6767
6868 # Update the splat if the parameters have values
69- if ($null -ne $PSBoundParameters.Connection )
70- {
69+ if ($null -ne $PSBoundParameters.Connection ) {
7170 $getServiceNowTableSplat.Add (' Connection' , $Connection )
7271 }
73- elseif ($null -ne $PSBoundParameters.ServiceNowCredential -and $null -ne $PSBoundParameters.ServiceNowURL )
74- {
75- $getServiceNowTableSplat.Add (' ServiceNowCredential' , $ServiceNowCredential )
76- $getServiceNowTableSplat.Add (' ServiceNowURL' , $ServiceNowURL )
72+ elseif ($null -ne $PSBoundParameters.ServiceNowCredential -and $null -ne $PSBoundParameters.ServiceNowURL ) {
73+ $getServiceNowTableSplat.Add (' ServiceNowCredential' , $ServiceNowCredential )
74+ $getServiceNowTableSplat.Add (' ServiceNowURL' , $ServiceNowURL )
7775 }
7876
7977 # Perform query and return each object in the format.ps1xml format
0 commit comments