Skip to content

Module fails to import/connect on PowerShell 7.6.x — Add-Type can't resolve System.Private.ServiceModel #129

Description

@Jakez84

Module version: Autotask 2.0.3 PowerShell versions tested: 7.2.24 (works), 7.6.3 and 7.6.4 (both broken) OS: Windows

Import-Module error:

Add-Type: Cannot find path 'C:\Users...\System.Private.ServiceModel.dll' because it does not exist.

Connect-AtwsWebAPI error:

New-Object: ...\Autotask\2.0.3\Private\Connect-AtwsWebServices.ps1:93
Line |
93 | … otService = New-Object Autotask.ATWSSoapClient $anonymousBinding, $e …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find type [Autotask.ATWSSoapClient]: verify that the assembly containing this type is loaded.

Commenting out 'System.Private.ServiceModel' in Autotask.psm1 seems to resolve the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions