diff --git a/Autotask_v1_5/Autotask.nuspec b/Autotask/Autotask.nuspec similarity index 100% rename from Autotask_v1_5/Autotask.nuspec rename to Autotask/Autotask.nuspec diff --git a/Autotask_v1_5/Autotask.psd1 b/Autotask/Autotask.psd1 similarity index 100% rename from Autotask_v1_5/Autotask.psd1 rename to Autotask/Autotask.psd1 diff --git a/Autotask_v1_5/Autotask.psm1 b/Autotask/Autotask.psm1 similarity index 100% rename from Autotask_v1_5/Autotask.psm1 rename to Autotask/Autotask.psm1 diff --git a/Autotask_v1_5/Private/Convert-AtwsFunctionToText.ps1 b/Autotask/Private/Convert-AtwsFunctionToText.ps1 similarity index 100% rename from Autotask_v1_5/Private/Convert-AtwsFunctionToText.ps1 rename to Autotask/Private/Convert-AtwsFunctionToText.ps1 diff --git a/Autotask_v1_5/Private/ConvertTo-PSObject.ps1 b/Autotask/Private/ConvertTo-PSObject.ps1 similarity index 100% rename from Autotask_v1_5/Private/ConvertTo-PSObject.ps1 rename to Autotask/Private/ConvertTo-PSObject.ps1 diff --git a/Autotask_v1_5/Private/ConvertTo-QueryXML.ps1 b/Autotask/Private/ConvertTo-QueryXML.ps1 similarity index 100% rename from Autotask_v1_5/Private/ConvertTo-QueryXML.ps1 rename to Autotask/Private/ConvertTo-QueryXML.ps1 diff --git a/Autotask_v1_5/Private/Get-AtwsCacheInfo.ps1 b/Autotask/Private/Get-AtwsCacheInfo.ps1 similarity index 100% rename from Autotask_v1_5/Private/Get-AtwsCacheInfo.ps1 rename to Autotask/Private/Get-AtwsCacheInfo.ps1 diff --git a/Autotask_v1_5/Private/Get-AtwsDefinition.ps1 b/Autotask/Private/Get-AtwsDefinition.ps1 similarity index 100% rename from Autotask_v1_5/Private/Get-AtwsDefinition.ps1 rename to Autotask/Private/Get-AtwsDefinition.ps1 diff --git a/Autotask_v1_5/Private/Get-AtwsFieldInfo.ps1 b/Autotask/Private/Get-AtwsFieldInfo.ps1 similarity index 100% rename from Autotask_v1_5/Private/Get-AtwsFieldInfo.ps1 rename to Autotask/Private/Get-AtwsFieldInfo.ps1 diff --git a/Autotask_v1_5/Private/Get-AtwsFunctionDefinition.ps1 b/Autotask/Private/Get-AtwsFunctionDefinition.ps1 similarity index 100% rename from Autotask_v1_5/Private/Get-AtwsFunctionDefinition.ps1 rename to Autotask/Private/Get-AtwsFunctionDefinition.ps1 diff --git a/Autotask_v1_5/Private/Get-AtwsHelpText.ps1 b/Autotask/Private/Get-AtwsHelpText.ps1 similarity index 100% rename from Autotask_v1_5/Private/Get-AtwsHelpText.ps1 rename to Autotask/Private/Get-AtwsHelpText.ps1 diff --git a/Autotask_v1_5/Private/Get-AtwsInvoiceInfo.ps1 b/Autotask/Private/Get-AtwsInvoiceInfo.ps1 similarity index 100% rename from Autotask_v1_5/Private/Get-AtwsInvoiceInfo.ps1 rename to Autotask/Private/Get-AtwsInvoiceInfo.ps1 diff --git a/Autotask_v1_5/Private/Get-AtwsPSParameter.ps1 b/Autotask/Private/Get-AtwsPSParameter.ps1 similarity index 100% rename from Autotask_v1_5/Private/Get-AtwsPSParameter.ps1 rename to Autotask/Private/Get-AtwsPSParameter.ps1 diff --git a/Autotask_v1_5/Private/Get-AtwsParameterDefinition.ps1 b/Autotask/Private/Get-AtwsParameterDefinition.ps1 similarity index 100% rename from Autotask_v1_5/Private/Get-AtwsParameterDefinition.ps1 rename to Autotask/Private/Get-AtwsParameterDefinition.ps1 diff --git a/Autotask_v1_5/Private/Get-CallerPreference.ps1 b/Autotask/Private/Get-CallerPreference.ps1 similarity index 100% rename from Autotask_v1_5/Private/Get-CallerPreference.ps1 rename to Autotask/Private/Get-CallerPreference.ps1 diff --git a/Autotask_v1_5/Private/Get-Copyright.ps1 b/Autotask/Private/Get-Copyright.ps1 similarity index 100% rename from Autotask_v1_5/Private/Get-Copyright.ps1 rename to Autotask/Private/Get-Copyright.ps1 diff --git a/Autotask_v1_5/Private/Import-AtwsCmdLet.ps1 b/Autotask/Private/Import-AtwsCmdLet.ps1 similarity index 100% rename from Autotask_v1_5/Private/Import-AtwsCmdLet.ps1 rename to Autotask/Private/Import-AtwsCmdLet.ps1 diff --git a/Autotask_v1_5/Private/New-AtwsDefinition.ps1 b/Autotask/Private/New-AtwsDefinition.ps1 similarity index 100% rename from Autotask_v1_5/Private/New-AtwsDefinition.ps1 rename to Autotask/Private/New-AtwsDefinition.ps1 diff --git a/Autotask_v1_5/Private/Remove-AtwsDefinition.ps1 b/Autotask/Private/Remove-AtwsDefinition.ps1 similarity index 100% rename from Autotask_v1_5/Private/Remove-AtwsDefinition.ps1 rename to Autotask/Private/Remove-AtwsDefinition.ps1 diff --git a/Autotask_v1_5/Private/Set-AtwsDefinition.ps1 b/Autotask/Private/Set-AtwsDefinition.ps1 similarity index 100% rename from Autotask_v1_5/Private/Set-AtwsDefinition.ps1 rename to Autotask/Private/Set-AtwsDefinition.ps1 diff --git a/Autotask_v1_5/Public/Connect-AutotaskWebAPI.ps1 b/Autotask/Public/Connect-AutotaskWebAPI.ps1 similarity index 92% rename from Autotask_v1_5/Public/Connect-AutotaskWebAPI.ps1 rename to Autotask/Public/Connect-AutotaskWebAPI.ps1 index 5730ac95..1218675d 100644 --- a/Autotask_v1_5/Public/Connect-AutotaskWebAPI.ps1 +++ b/Autotask/Public/Connect-AutotaskWebAPI.ps1 @@ -49,6 +49,9 @@ Function Connect-AutotaskWebAPI { [ValidateNotNullOrEmpty()] [pscredential] $Credential = $(Get-Credential -Message 'Autotask Web Services API login'), + + [String] + $ApiTrackingIdentifier, [Switch] $NoDynamicModule = $False, @@ -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 = @{} @@ -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' } } @@ -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 { diff --git a/Autotask_v1_5/Public/Get-AtwsData.ps1 b/Autotask/Public/Get-AtwsData.ps1 similarity index 100% rename from Autotask_v1_5/Public/Get-AtwsData.ps1 rename to Autotask/Public/Get-AtwsData.ps1 diff --git a/Autotask_v1_5/Public/New-AtwsData.ps1 b/Autotask/Public/New-AtwsData.ps1 similarity index 100% rename from Autotask_v1_5/Public/New-AtwsData.ps1 rename to Autotask/Public/New-AtwsData.ps1 diff --git a/Autotask_v1_5/Public/Remove-AtwsData.ps1 b/Autotask/Public/Remove-AtwsData.ps1 similarity index 100% rename from Autotask_v1_5/Public/Remove-AtwsData.ps1 rename to Autotask/Public/Remove-AtwsData.ps1 diff --git a/Autotask_v1_5/Public/Set-AtwsData.ps1 b/Autotask/Public/Set-AtwsData.ps1 similarity index 100% rename from Autotask_v1_5/Public/Set-AtwsData.ps1 rename to Autotask/Public/Set-AtwsData.ps1 diff --git a/Autotask_v1_6/Autotask.nuspec b/Autotask2/Autotask.nuspec similarity index 100% rename from Autotask_v1_6/Autotask.nuspec rename to Autotask2/Autotask.nuspec diff --git a/Autotask_v1_6/Autotask.psd1 b/Autotask2/Autotask.psd1 similarity index 100% rename from Autotask_v1_6/Autotask.psd1 rename to Autotask2/Autotask.psd1 diff --git a/Autotask_v1_6/Autotask.psm1 b/Autotask2/Autotask.psm1 similarity index 100% rename from Autotask_v1_6/Autotask.psm1 rename to Autotask2/Autotask.psm1 diff --git a/Autotask_v1_6/Private/Convert-AtwsFunctionToText.ps1 b/Autotask2/Private/Convert-AtwsFunctionToText.ps1 similarity index 100% rename from Autotask_v1_6/Private/Convert-AtwsFunctionToText.ps1 rename to Autotask2/Private/Convert-AtwsFunctionToText.ps1 diff --git a/Autotask_v1_6/Private/ConvertTo-PSObject.ps1 b/Autotask2/Private/ConvertTo-PSObject.ps1 similarity index 100% rename from Autotask_v1_6/Private/ConvertTo-PSObject.ps1 rename to Autotask2/Private/ConvertTo-PSObject.ps1 diff --git a/Autotask_v1_6/Private/ConvertTo-QueryXML.ps1 b/Autotask2/Private/ConvertTo-QueryXML.ps1 similarity index 100% rename from Autotask_v1_6/Private/ConvertTo-QueryXML.ps1 rename to Autotask2/Private/ConvertTo-QueryXML.ps1 diff --git a/Autotask_v1_6/Private/Get-AtwsCacheInfo.ps1 b/Autotask2/Private/Get-AtwsCacheInfo.ps1 similarity index 100% rename from Autotask_v1_6/Private/Get-AtwsCacheInfo.ps1 rename to Autotask2/Private/Get-AtwsCacheInfo.ps1 diff --git a/Autotask_v1_6/Private/Get-AtwsDefinition.ps1 b/Autotask2/Private/Get-AtwsDefinition.ps1 similarity index 100% rename from Autotask_v1_6/Private/Get-AtwsDefinition.ps1 rename to Autotask2/Private/Get-AtwsDefinition.ps1 diff --git a/Autotask_v1_6/Private/Get-AtwsFieldInfo.ps1 b/Autotask2/Private/Get-AtwsFieldInfo.ps1 similarity index 100% rename from Autotask_v1_6/Private/Get-AtwsFieldInfo.ps1 rename to Autotask2/Private/Get-AtwsFieldInfo.ps1 diff --git a/Autotask_v1_6/Private/Get-AtwsFunctionDefinition.ps1 b/Autotask2/Private/Get-AtwsFunctionDefinition.ps1 similarity index 100% rename from Autotask_v1_6/Private/Get-AtwsFunctionDefinition.ps1 rename to Autotask2/Private/Get-AtwsFunctionDefinition.ps1 diff --git a/Autotask_v1_6/Private/Get-AtwsHelpText.ps1 b/Autotask2/Private/Get-AtwsHelpText.ps1 similarity index 100% rename from Autotask_v1_6/Private/Get-AtwsHelpText.ps1 rename to Autotask2/Private/Get-AtwsHelpText.ps1 diff --git a/Autotask_v1_6/Private/Get-AtwsInvoiceInfo.ps1 b/Autotask2/Private/Get-AtwsInvoiceInfo.ps1 similarity index 100% rename from Autotask_v1_6/Private/Get-AtwsInvoiceInfo.ps1 rename to Autotask2/Private/Get-AtwsInvoiceInfo.ps1 diff --git a/Autotask_v1_6/Private/Get-AtwsPSParameter.ps1 b/Autotask2/Private/Get-AtwsPSParameter.ps1 similarity index 100% rename from Autotask_v1_6/Private/Get-AtwsPSParameter.ps1 rename to Autotask2/Private/Get-AtwsPSParameter.ps1 diff --git a/Autotask_v1_6/Private/Get-AtwsParameterDefinition.ps1 b/Autotask2/Private/Get-AtwsParameterDefinition.ps1 similarity index 100% rename from Autotask_v1_6/Private/Get-AtwsParameterDefinition.ps1 rename to Autotask2/Private/Get-AtwsParameterDefinition.ps1 diff --git a/Autotask_v1_6/Private/Get-CallerPreference.ps1 b/Autotask2/Private/Get-CallerPreference.ps1 similarity index 100% rename from Autotask_v1_6/Private/Get-CallerPreference.ps1 rename to Autotask2/Private/Get-CallerPreference.ps1 diff --git a/Autotask_v1_6/Private/Get-Copyright.ps1 b/Autotask2/Private/Get-Copyright.ps1 similarity index 100% rename from Autotask_v1_6/Private/Get-Copyright.ps1 rename to Autotask2/Private/Get-Copyright.ps1 diff --git a/Autotask_v1_6/Private/Import-AtwsCmdLet.ps1 b/Autotask2/Private/Import-AtwsCmdLet.ps1 similarity index 100% rename from Autotask_v1_6/Private/Import-AtwsCmdLet.ps1 rename to Autotask2/Private/Import-AtwsCmdLet.ps1 diff --git a/Autotask_v1_6/Private/New-AtwsDefinition.ps1 b/Autotask2/Private/New-AtwsDefinition.ps1 similarity index 100% rename from Autotask_v1_6/Private/New-AtwsDefinition.ps1 rename to Autotask2/Private/New-AtwsDefinition.ps1 diff --git a/Autotask_v1_6/Private/Remove-AtwsDefinition.ps1 b/Autotask2/Private/Remove-AtwsDefinition.ps1 similarity index 100% rename from Autotask_v1_6/Private/Remove-AtwsDefinition.ps1 rename to Autotask2/Private/Remove-AtwsDefinition.ps1 diff --git a/Autotask_v1_6/Private/Set-AtwsDefinition.ps1 b/Autotask2/Private/Set-AtwsDefinition.ps1 similarity index 100% rename from Autotask_v1_6/Private/Set-AtwsDefinition.ps1 rename to Autotask2/Private/Set-AtwsDefinition.ps1 diff --git a/Autotask_v1_6/Public/Connect-AutotaskWebAPI.ps1 b/Autotask2/Public/Connect-AutotaskWebAPI.ps1 similarity index 97% rename from Autotask_v1_6/Public/Connect-AutotaskWebAPI.ps1 rename to Autotask2/Public/Connect-AutotaskWebAPI.ps1 index 36fd5b9e..347a46c2 100644 --- a/Autotask_v1_6/Public/Connect-AutotaskWebAPI.ps1 +++ b/Autotask2/Public/Connect-AutotaskWebAPI.ps1 @@ -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 = @{} diff --git a/Autotask_v1_6/Public/Get-AtwsData.ps1 b/Autotask2/Public/Get-AtwsData.ps1 similarity index 100% rename from Autotask_v1_6/Public/Get-AtwsData.ps1 rename to Autotask2/Public/Get-AtwsData.ps1 diff --git a/Autotask_v1_6/Public/New-AtwsData.ps1 b/Autotask2/Public/New-AtwsData.ps1 similarity index 100% rename from Autotask_v1_6/Public/New-AtwsData.ps1 rename to Autotask2/Public/New-AtwsData.ps1 diff --git a/Autotask_v1_6/Public/Remove-AtwsData.ps1 b/Autotask2/Public/Remove-AtwsData.ps1 similarity index 100% rename from Autotask_v1_6/Public/Remove-AtwsData.ps1 rename to Autotask2/Public/Remove-AtwsData.ps1 diff --git a/Autotask_v1_6/Public/Set-AtwsData.ps1 b/Autotask2/Public/Set-AtwsData.ps1 similarity index 100% rename from Autotask_v1_6/Public/Set-AtwsData.ps1 rename to Autotask2/Public/Set-AtwsData.ps1