File tree Expand file tree Collapse file tree 1 file changed +28
-3
lines changed
Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Original file line number Diff line number Diff line change 11function Set-ServiceNowAuth {
2- param (
2+ <#
3+ . SYNOPSIS
4+ Configures default connection settings for the Service-Now Instance
5+ . DESCRIPTION
6+ The Set-ServiceNowAuth function configures default connection settings for the Service-Now Instance. These include the instance URL,
7+ authentication credentials and date format.
8+ . INPUTS
9+ None
10+ . OUTPUTS
11+ System.Boolean
12+ . LINK
13+ Service-Now Kingston Release REST API Reference: https://docs.servicenow.com/bundle/kingston-application-development/page/build/applications/concept/api-rest.html
14+ Service-Now Table API FAQ: https://hi.service-now.com/kb_view.do?sysparm_article=KB0534905
15+ #>
16+ param (
17+ # The URL for the ServiceNow instance being used
318 [parameter (mandatory = $true )]
419 [string ]$url ,
520
21+ # Credential used to authenticate to ServiceNow
622 [parameter (mandatory = $true )]
7- [System.Management.Automation.PSCredential ]$Credentials
8- )
23+ [System.Management.Automation.PSCredential ]$Credentials ,
24+
25+ # The date format specified in the Service-Now Instance, sys_properties table, property glide.sys.data_format. This is required
26+ # to correctly convert datetime fields to the local computer locale format when the DisplayValues parameter of the Get-* functions
27+ # is set to true
28+ [parameter (mandatory = $false )]
29+ [String ]$DateFormat = (Get-Culture ).DateTimeFormat.ShortDatePattern+ ' ' + (Get-Culture ).DateTimeFormat.LongTimePattern
30+ )
31+
932 $Global :ServiceNowURL = ' https://' + $url
1033 $Global :ServiceNowRESTURL = $ServiceNowURL + ' /api/now/v1'
1134 $Global :ServiceNowCredentials = $credentials
35+ $Global :ServiceNowDateFormat = $DateFormat
36+
1237 return $true ;
1338}
You can’t perform that action at this time.
0 commit comments