Skip to content

Instantly share code, notes, and snippets.

@leandroribeiro
Created March 14, 2024 14:02
Show Gist options
  • Save leandroribeiro/418c631edfd70c120878c4ec961af719 to your computer and use it in GitHub Desktop.
Save leandroribeiro/418c631edfd70c120878c4ec961af719 to your computer and use it in GitHub Desktop.
Serverless Invoke using file data
$token = $args[0]
$original_dir = Get-Location
Set-Location ..
(Get-Content "$original_dir\event.json" -Raw) -replace "#TOKEN#", $token | Set-Content "$original_dir\event.tmp.json"
serverless invoke --function validateToken --path "$original_dir\event.tmp.json" --config .\serverless.yml --log
Remove-Item "$original_dir\event.tmp.json"
Set-Location "$original_dir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment