-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remote connect new-pssession fails - Unable to load shared library 'libpsrpclient' or one of its dependencies. #332
Comments
I have noticed the same problem when attempting to deploy a powershell lambda function. Executes locally correctly, but fails in lambda with the above error. |
Same here, I notice the Get-PSSesssionOption is also missing. I'm thinking the Publish-AWSPowershellLambda is not capturing all the DLLs for PSCore into the zip. |
This may also be relevant, they changed libpsrpclient to psrp, maybe something in the code didn't get the memo: |
Good afternoon. I was going through backlog and came across this issue. Please refer the forum article https://forums.aws.amazon.com/thread.jspa?messageID=918094 for possible solution. Kindly note that Lambda works on minimal RHEL image. Let me know if it works for you. Thanks, |
This issue has not recieved a response in 2 weeks. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled. |
The solutions suggested in the AWS forums doesn't work for me. I'm on MacOS and can't seem to find following dependecies : I copied them from /opt/microsoft/powershell/6/ to ~/.nuget/packages/microsoft.powershell.native/6.1.0/runtimes/linux-x64/native. |
Followed the steps given in the URL and deployed below Powershell Core script as a Lambda Function.
--------------------------------------- Script ---------------------------------
#Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.335.0'}
$pw = convertto-securestring -AsPlainText -Force -String "Password"
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "UserID",$pw
$s = new-pssession -computername "AWSECS2DNS" -credential $cred
Invoke-Command -Session $s -ScriptBlock {Get-Service}
When trigger the Lambda function, It fails. This Powershell script tries to remote connect a Windows EC2 Instance and run Commandlet "Get-Service". It fails at the Commandlet "new-pssession". Same script runs fine in Windows Computer powershell.
--------------------------------------- Error -----------------------------------------------
{
"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 Amazon.Lambda.PowerShellHost.PowerShellFunctionHost.ExecuteFunction(Stream inputStream, ILambdaContext context)",
"at lambda_method(Closure , Stream , Stream , LambdaContextInternal )"
]
}
The text was updated successfully, but these errors were encountered: