I am trying to package a script I have as a Lambda function. The script loads some functions from some other ps1 files in the same folder. Currently use "." to include.
When I try to use New-AWSPowerShellLambdaPackage -ProjectDirectory projectName -OutputPackage projectName.zip to package the script files, it keeps failing with error below.
Line |
253 | throw $msg
| ~~~~~~~~~~
| Error publishing PowerShell Lambda Function: -1 CALLSTACK: Command Arguments Location -------
| --------- -------- _packageProject
| {OutputPackage=C:\Users\tom\projectName\projectname.zip, BuildDirectory=projectName} _DeploymentFunctions.ps1: line 251 New-AWSPowerShellLambdaPackage {ProjectDirectory=projectName,
| OutputPackage=projectName.zip} New-AWSPowerShellLambdaPackage.ps1: line 182 <ScriptBlock> {}
| <No file>
Is this because I use "." to source the other ps1 files? Should I convert them into modules? Anyone can suggest any documentation for this? I can't seem to find any good source detailing how to package PowerShell lambda. All the examples I can find are for single ps1 file.