Last active
June 27, 2023 16:11
-
-
Save techthoughts2/1531106502cde794ac59f6afa36b2fcf to your computer and use it in GitHub Desktop.
Some basic code snips for PowerShell Lambda Stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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