How To Invoke A PowerShell Script Using Amazon Web Services (AWS) Lambda

System Administrators and Engineers of the world, rejoice! A new day is upon us. On this day, we’re able to use PowerShell in our AWS Lambda Functions. This opens the door wide open for Windows administrators to be able to use and automate all of their infrastructures on the AWS cloud platform.

In this Snip, Matt will walk you through how to invoke a PowerShell script using AWS Lambda and the AWSLambdaPSCore PowerShell module. From this module, we will be exploring Get-AWSPowerShellLambdaTemplate to get a list of available PowerShell Lambda templates to use in creating a script. From the basic template we will use New-AWSPowerShellLambda to create the files we need to make our script. After the script is configured, we will use Publish-AWSPowerShellLambda to publish the new PowerShell Lambda function to AWS where we will run and test the new script.

Prerequisites include: PowerShell 6.0 or higher AWSLambdaPSCore Module AWSPowerShell.NetCore Module .NET Core 2.1 SDK An AWS IAM role