Skip to content

Commit

Permalink
Folder rename. Steep learning curve here...
Browse files Browse the repository at this point in the history
  • Loading branch information
klemmestad committed Feb 18, 2019
1 parent 5d6fe32 commit 1f5638a
Show file tree
Hide file tree
Showing 50 changed files with 34 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Function Connect-AutotaskWebAPI {
[ValidateNotNullOrEmpty()]
[pscredential]
$Credential = $(Get-Credential -Message 'Autotask Web Services API login'),

[String]
$ApiTrackingIdentifier,

[Switch]
$NoDynamicModule = $False,
Expand All @@ -71,7 +74,15 @@ Function Connect-AutotaskWebAPI {
Begin {
Write-Verbose ('{0}: Begin of function' -F $MyInvocation.MyCommand.Name)

$DefaultUri = 'https://webservices.Autotask.net/atservices/1.5/atws.wsdl'
# API version 1.6 REQUIRES an API tracking identifier. If you provide it we connect to 1.6
If ($ApiTrackingIdentifier) {
$APIversion = '1.6'
}
Else {
$APIversion = '1.6'
}

$DefaultUri = 'https://webservices.Autotask.net/atservices/{0}/atws.wsdl' -F $APIversion

If (-not($global:AtwsConnection)) {
$global:AtwsConnection = @{}
Expand All @@ -89,7 +100,7 @@ Function Connect-AutotaskWebAPI {
# This is now a REQUIREMENT to talk to the API endpoints
$Protocol = [System.Net.ServicePointManager]::SecurityProtocol
If ($Protocol.ToString() -notlike '*Tls12*') {
[System.Net.ServicePointManager]::SecurityProtocol += 'tls12'
[System.Net.ServicePointManager]::SecurityProtocol += 'tls12'
}
}

Expand Down Expand Up @@ -162,6 +173,17 @@ Function Connect-AutotaskWebAPI {
$WebServiceProxy = New-WebServiceProxy -URI $Uri -Credential $local:Credential -Namespace 'Autotask' -Class 'AutotaskAPI' -ErrorAction Stop
# Make sure the webserviceproxy authenticates every time (saves a webconnection and a few milliseconds)
$WebServiceProxy.PreAuthenticate = $True

# Add API Integrations Value

# A dedicated object type has been created to store integration values
$AutotaskIntegrationsValue = New-Object Autotask.AutotaskIntegrations

# Set the integrationcode property to the API tracking identifier provided by the user
$AutotaskIntegrationsValue.IntegrationCode = $ApiTrackingIdentifier

# Add the integrations value to the Web Service Proxy
$WebServiceProxy.AutotaskIntegrationsValue = $AutotaskIntegrationsValue

}
Catch {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,16 @@ Function Connect-AutotaskWebAPI {

Begin {
Write-Verbose ('{0}: Begin of function' -F $MyInvocation.MyCommand.Name)

$DefaultUri = 'https://webservices.Autotask.net/atservices/1.6/atws.wsdl'

# API version 1.6 REQUIRES an API tracking identifier. If you provide it we connect to 1.6
If ($ApiTrackingIdentifier) {
$APIversion = '1.6'
}
Else {
$APIversion = '1.6'
}

$DefaultUri = 'https://webservices.Autotask.net/atservices/{0}/atws.wsdl' -F $APIversion

If (-not($global:AtwsConnection)) {
$global:AtwsConnection = @{}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1f5638a

Please sign in to comment.