How To Return Output From An Amazon Web Services (AWS) Lambda PowerShell Script

You’ve got your brand new Lambda PowerShell script created in AWS and now you don’t want to just have it do something, you want to have it return some useful data.

In this snip, Matt will walk you through how to write a Lambda PowerShell script that will collect some information and returns some data as a result of the Lambda function execution. We’ll use Publish-AWSPowerShellLambda to publish these changes to AWS then run a test event which will pass some data to our script and display its results. Matt will also go over the differences between writing information to the CloudWatch logs versus returning a result from the Lambda function.

Prerequisites include: Event and lambda function to test PowerShell 6.0 or higher AWSLambdaPSCore Module AWSPowerShell.NetCore Module .NET Core 2.1 SDK