Invoking AWS Lambda functions via the CLI behaves differently across Windows shells. The Linux command using single-quoted JSON payloads fails in both Command Prompt and PowerShell, requiring different escaping strategies for each. Command Prompt needs double quotes wrapping the payload with escaped inner quotes, while PowerShell uses single quotes with escaped inner double quotes. WSL Ubuntu and Git Bash accept the original Linux syntax unchanged. The post also covers the dotnet lambda invoke-function CLI tool as an alternative, detailing the shell-specific payload escaping for JSON objects and plain string payloads.

3m read timeFrom nodogmablog.bryanhogan.net
Post cover image
Table of contents
Command PromptPowerShellWSL Ubuntu and Git Bashdotnet lambda invoke-function