Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Last active June 27, 2023 16:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/1531106502cde794ac59f6afa36b2fcf to your computer and use it in GitHub Desktop.
Save techthoughts2/1531106502cde794ac59f6afa36b2fcf to your computer and use it in GitHub Desktop.
Some basic code snips for PowerShell Lambda Stuff
#Download the .NET Core 2.1 SDK from https://www.microsoft.com/net/download
Install-Module AWSPowerShell.NetCore
Install-Module AWSLambdaPSCore
Import-Module AWSPowerShell.NetCore
Import-Module AWSLambdaPSCore
Get-Command -Module AWSLambdaPSCore
New-Item PSLambda -ItemType Directory
New-AWSPowerShellLambda -Template Basic -ScriptName ScriptTest
#Configuring script to use installed version 3.3.390.0 of AWSPowerShell.NetCore.
#Created new AWS Lambda PowerShell script ScriptTest.ps1 from template Basic at C:\directory\PSLambda\ScriptTest
Publish-AWSPowerShellLambda -Name ScriptTest -ScriptPath .\ScriptTest.ps1
(Invoke-LMFunction -FunctionName ScriptTest -Payload '{"foo":"bar"}').payload | ConvertTo-String
Publish-AWSPowerShellLambda -Name ScriptTest -ScriptPath .\ScriptTest.ps1 -PowerShellFunctionHandler Send-TestFunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment