Building with PowerShell
Handler
Note You're required to use the
#Requiresstatement 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#Requiresstatement 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#Requiresstatement that references theAWSPowerShell.NetCoremodule, which supports PowerShell Core—and not theAWSPowerShellmodule, which only supports Windows PowerShell. Also, be sure to use version 3.3.270.0 or newer ofAWSPowerShell.NetCorewhich 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
Was this helpful?