Skip to content

Connecting to ExchangeOnline through Lambda PowerShell fails with: "Unable to load shared library 'libpsrpclient' or one of its dependencies... #203

@andybirenzi

Description

@andybirenzi

Description

I'm have following script in my pwsh lambda function:

Reproduction Steps

$creds = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $secureStringPwd

Connect to Exchange Online

Connect-ExchangeOnline -Credential $creds

Logs

"errorType": "PSRemotingTransportException",
"errorMessage": "This parameter set requires WSMan, and no supported WSMan client library was found. WSMan is either not installed or unavailable for this system.",
"stackTrace": [
"at Amazon.Lambda.PowerShellHost.PowerShellFunctionHost.ExecuteFunction(Stream inputStream, ILambdaContext context)",
"at lambda_method(Closure , Stream , Stream , LambdaContextInternal )"
],
"cause": {
"errorType": "DllNotFoundException",
"errorMessage": "Unable to load shared library 'libpsrpclient' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibpsrpclient: cannot open shared object file: No such file or directory",
"stackTrace": [
"at System.Management.Automation.Remoting.Client.WSManNativeApi.WSManInitialize(Int32 flags, IntPtr& wsManAPIHandle)",
"at System.Management.Automation.Remoting.Client.WSManClientSessionTransportManager.WSManAPIDataCommon..ctor()"
]
}

Environment

  • Build Version:
  • OS Info:
  • Build Environment:
  • Targeted .NET Platform:
    Name Value

PSVersion 7.1.2
PSEdition Core
GitCommitId 7.1.2
OS Darwin 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_…
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Resolution

  • 👋 I can/would-like-to implement a fix for this problem myself

I just need PowerShell to connect to ExchangeOnline through ModenAuth


This is a 🐛 bug-report

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions