Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This new PowerShell custom runtime for AWS Lambda makes it even easier to run Lambda functions written in PowerShell to process events.

License

NotificationsYou must be signed in to change notification settings

awslabs/aws-lambda-powershell-runtime

ThisPowerShell custom runtime forAWS Lambda enables running Lambda functions written in PowerShell to process events.

Your code runs in an Amazon Linux environment that includes AWS credentials from anAWS Identity and Access Management (IAM) role that you manage.

Overview

Lambda has supported running PowerShell since 2018. However, the existing solution uses the .NET Core runtimeimplementation for PowerShell. It uses the additionalAWSLambdaPSCore modules for deployment and publishing, which require compiling the PowerShell code into C# binaries to run on .NET. This adds additional steps to the development process.

This runtime uses Lambda'scustom runtime functionality based on theprovided.al2023 runtime.

PowerShell custom runtime benefits

  • Native PowerShell. This runtime uses native PowerShell.

    • The function runtime environment matches a standard PowerShell session, which simplifies the development and testing process.
    • No compilation step required and no hosting on the .NET runtime.
    • Allows additional functionality, such asAdd-Type to provide richer context information.
  • Code visibility. You can view and edit PowerShell code within the Lambda console's built-incode editor when using .zip archive functions (not container images). You can embed PowerShell code within anAWS CloudFormation template, or other infrastructure as code tools.

  • Output. This custom runtime returns everything placed on the pipeline as the function output, including the output ofWrite-Output.This gives you more control over the function output, error messages, and logging. With the previous .NET runtime implementation, your function returns only the last output from the PowerShell pipeline. Unhandled exceptions are caught by the runtime, then they are logged to the log stream and a error result is returned to the caller.

Development Requirements

Testing

The runtime includes unit tests and integration tests:

  • Unit Tests: Automated tests covering runtime functions and build processes
  • Integration Tests: Manual tests with real AWS Lambda functions for end-to-end validation

Seepowershell-runtime/tests/README.md for testing documentation and commands.

Building and Deploying

You can build the custom runtime using AWS SAM or other infrastructure-as-code tools. Deploy the exampledemo-runtime-layer-function to explore how the runtime works.

Seepowershell-runtime/README.md for detailed deployment instructions.

Project Structure

Examples

ExampleDescription
demo-runtime-layer-functionComplete runtime layer with AWS Tools and multiple handler options
demo-s3-lambda-eventbridgeEvent-driven application processing S3 files with EventBridge
demo-container-image-all-aws-sdkContainer image deployment with full AWS SDK
demo-container-images-sharedShared container layers for multiple functions

Runtime Information

See thePowerShell-runtime documentation for detailed information on runtime variables, handler options, context objects, module support, logging, and error handling.

Acknowledgements

This custom runtime builds on the work ofNorm Johanson,Kevin Marquette,Andrew Pearce, Afroz Mohammed, and Jonathan Nunn.

Security

SeeCONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

About

This new PowerShell custom runtime for AWS Lambda makes it even easier to run Lambda functions written in PowerShell to process events.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp