Skip to content

Commit 708521e

Browse files
committed
Set Table param mandatory, cleaned up all param settings
1 parent 0318e43 commit 708521e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ServiceNow/Public/Get-ServiceNowTable.ps1

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,39 @@ function Get-ServiceNowTable
44
Param
55
(
66
# Name of the table we're querying (e.g. incidents)
7-
[parameter(ParameterSetName='SpecifyConnectionFields', mandatory=$false)]
7+
[parameter(Mandatory)]
8+
[parameter(ParameterSetName='SpecifyConnectionFields')]
89
[parameter(ParameterSetName='UseConnectionObject')]
910
[parameter(ParameterSetName='SetGlobalAuth')]
11+
[ValidateNotNullOrEmpty()]
1012
[string]$Table,
1113

1214
# sysparm_query param in the format of a ServiceNow encoded query string (see http://wiki.servicenow.com/index.php?title=Encoded_Query_Strings)
13-
[parameter(ParameterSetName='SpecifyConnectionFields', mandatory=$false)]
15+
[parameter(ParameterSetName='SpecifyConnectionFields')]
1416
[parameter(ParameterSetName='UseConnectionObject')]
1517
[parameter(ParameterSetName='SetGlobalAuth')]
1618
[string]$Query,
1719

1820
# Maximum number of records to return
19-
[parameter(ParameterSetName='SpecifyConnectionFields', mandatory=$false)]
21+
[parameter(ParameterSetName='SpecifyConnectionFields')]
2022
[parameter(ParameterSetName='UseConnectionObject')]
2123
[parameter(ParameterSetName='SetGlobalAuth')]
2224
[int]$Limit=10,
2325

2426
# Whether or not to show human readable display values instead of machine values
25-
[parameter(ParameterSetName='SpecifyConnectionFields', mandatory=$false)]
27+
[parameter(ParameterSetName='SpecifyConnectionFields')]
2628
[parameter(ParameterSetName='UseConnectionObject')]
2729
[parameter(ParameterSetName='SetGlobalAuth')]
28-
[ValidateSet("true","false", "all")]
30+
[ValidateSet("true","false","all")]
2931
[string]$DisplayValues='false',
3032

3133
# Credential used to authenticate to ServiceNow
32-
[Parameter(ParameterSetName='SpecifyConnectionFields', Mandatory=$True)]
34+
[Parameter(ParameterSetName='SpecifyConnectionFields')]
3335
[ValidateNotNullOrEmpty()]
3436
[PSCredential]
3537
$ServiceNowCredential,
3638

37-
# The URL for the ServiceNow instance being used
39+
# The URL for the ServiceNow instance being used
3840
[Parameter(ParameterSetName='SpecifyConnectionFields', Mandatory=$True)]
3941
[ValidateNotNullOrEmpty()]
4042
[string]

0 commit comments

Comments
 (0)