Invoking Lambda through the AWS API Gateway with PowerShell

The ability to invoke Lamda functions via REST based web API is incredibly powerful. As the API gateway is relatively new functionality, the documentation surrounding REST requests and PowerShell is sparse with official documentation sometimes confusing and appearing to be contradictory.

The attached PowerShell routine can be used to make signed GET and POST requests to an API advertised Lambda script.

The script accepts a JSON payload as a text string. With a PUT, properties can be directly referenced within Lambda using directly using a call such as: “event['name']”