Building with PowerShell

This page was generated from content adapted from the AWS Developer Guide


  • Note You're required to use the #Requires statement within your PowerShell scripts to indicate the modules that your scripts depend on. This statement performs two important tasks. 1) It communicates to other developers which modules the script uses, and 2) it identifies the dependent modules that AWS PowerShell tools need to package with the script, as part of the deployment. For more information about the #Requires statement in PowerShell, see About requires. For more information about PowerShell deployment packages, see Deploy PowerShell Lambda functions with .zip file archives. When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a #Requires statement that references the AWSPowerShell.NetCore module, which supports PowerShell Core—and not the AWSPowerShell module, which only supports Windows PowerShell. Also, be sure to use version or newer of AWSPowerShell.NetCore which optimizes the cmdlet import process. If you use an older version, you'll experience longer cold starts. For more information, see AWS Tools for PowerShell.

Last updated