To use the New-AWSPowerShellLambdaPackage command, I must either generate the package from a single ps1 file (-ScriptFile parameter) or create a C# project to run the PowerShell script (-ProjectDirectory parameter).
I want to split some of the code of function into another file and package it along with the main script file. However, I don't want to write my C# project.
Please provide a new option for the New-AWSPowerShellLambdaPackage command that only requires multiple ps1 files and packages them.
Is your Feature Request related to a problem?
Separating common code for multiple functions into an external file improves code maintainability.
Proposed Solution
Add a new parameter set to the New-AWSPowerShellLambdaPackage command.
To load all the files and then start executing, I need to specify an entry point.
I can accomplish my goal by combining the common code into a separate PowerShell module and loading it with #Requires -Module.
However, #Requires -Module cannot specify a path relative to the main script file, so the module must be in a directory registered in the PSModulePath environment variable.
This is inconvenient for source control.
Additional Context
Environment
[ ] :wave: I may be able to implement this feature request
[ ] :warning: This feature might incur a breaking change
We have noticed this issue has not recieved attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.
Describe the Feature
To use the
New-AWSPowerShellLambdaPackage
command, I must either generate the package from a single ps1 file (-ScriptFile
parameter) or create a C# project to run the PowerShell script (-ProjectDirectory
parameter).I want to split some of the code of function into another file and package it along with the main script file. However, I don't want to write my C# project.
Please provide a new option for the
New-AWSPowerShellLambdaPackage
command that only requires multiple ps1 files and packages them.Is your Feature Request related to a problem?
Separating common code for multiple functions into an external file improves code maintainability.
Proposed Solution
Add a new parameter set to the
New-AWSPowerShellLambdaPackage
command. To load all the files and then start executing, I need to specify an entry point.For example:
Describe alternatives you've considered
I can accomplish my goal by combining the common code into a separate PowerShell module and loading it with
#Requires -Module
. However,#Requires -Module
cannot specify a path relative to the main script file, so the module must be in a directory registered in thePSModulePath
environment variable. This is inconvenient for source control.Additional Context
Environment
This is a :rocket: Feature Request