Skip to content

Commit

Permalink
standardize param names
Browse files Browse the repository at this point in the history
  • Loading branch information
gdbarron committed Nov 19, 2023
1 parent d51a9d1 commit 03d127e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions ServiceNow/Public/New-ServiceNowChangeRequest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
.PARAMETER ConfigurationItem
Full name or sys_id of the configuration item to be associated with the change
.PARAMETER InputData
.PARAMETER CustomField
Field values which aren't one of the built in function properties
.PARAMETER ServiceNowSession
Expand Down Expand Up @@ -109,8 +109,8 @@ function New-ServiceNowChangeRequest {
[string] $ConfigurationItem,

[parameter()]
[Alias('CustomFields')]
[hashtable] $InputData,
[Alias('CustomFields', 'InputData')]
[hashtable] $CustomField,

[Parameter()]
[Hashtable] $Connection,
Expand Down Expand Up @@ -141,12 +141,12 @@ function New-ServiceNowChangeRequest {
}

# add custom fields
$duplicateValues = ForEach ($Key in $InputData.Keys) {
$duplicateValues = ForEach ($Key in $CustomField.Keys) {
If ( $values.ContainsKey($Key) ) {
$Key
}
Else {
$values.Add($Key, $InputData[$Key])
$values.Add($Key, $CustomField[$Key])
}
}

Expand Down
12 changes: 6 additions & 6 deletions ServiceNow/Public/New-ServiceNowIncident.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Generates a new ServiceNow Incident using predefined or other field values
.PARAMETER ConfigurationItem
Full name or sys_id of the configuration item to be associated with the change
.PARAMETER InputData
.PARAMETER CustomField
Field values which aren't one of the built in function properties
.PARAMETER ServiceNowSession
Expand All @@ -56,7 +56,7 @@ Generate a basic Incident attributed to the caller "UserName" with descriptions,
Category = "Office"
Subcategory = "Outlook"
ConfigurationItem = "UserPC1"
InputData = @{u_custom1 = "Custom Field Entry"
CustomField = @{u_custom1 = "Custom Field Entry"
u_another_custom = "Related Test"}
}
New-ServiceNowIncident @IncidentParams
Expand Down Expand Up @@ -93,8 +93,8 @@ function New-ServiceNowIncident {
[string] $ConfigurationItem,

[parameter()]
[Alias('CustomFields')]
[hashtable] $InputData,
[Alias('CustomFields', 'InputData')]
[hashtable] $CustomField,

[Parameter()]
[Hashtable] $Connection,
Expand Down Expand Up @@ -124,12 +124,12 @@ function New-ServiceNowIncident {
}

# add custom fields
$duplicateValues = ForEach ($Key in $InputData.Keys) {
$duplicateValues = ForEach ($Key in $CustomField.Keys) {
If ( $values.ContainsKey($Key) ) {
$Key
}
Else {
$values.Add($Key, $InputData[$Key])
$values.Add($Key, $CustomField[$Key])
}
}

Expand Down

0 comments on commit 03d127e

Please sign in to comment.