Notices: This section not yet converted to new layout. Download stats are rolling back out.

AWS Lambda for PowerShell Core (PowerShell Module)

1.2.0.0

Package test results are passing.

This package was approved by moderator mkevenaar on 2/8/2019.

The AWS Lambda Tools for Powershell allows PowerShell developers to publish PowerShell scripts with their dependent modules and have the scripts be invoked by Lambda.

NOTE: This module requires PowerShell Core.

NOTE: This is an automatically updated package. If you find it is out of date by more than a week, please contact the maintainer(s) and let them know the package is no longer updating correctly.

To install AWS Lambda for PowerShell Core (PowerShell Module), run the following command from the command line or from PowerShell:

C:\> choco install awslambdapscore

To upgrade AWS Lambda for PowerShell Core (PowerShell Module), run the following command from the command line or from PowerShell:

C:\> choco upgrade awslambdapscore

Files

Hide
  • tools\.skipAutoUninstaller
  • tools\AWSLambdaPSCore\AWSLambdaPSCore.psd1 Show
    #
    # Module manifest for module 'PSGet_AWSLambdaPSCore'
    #
    # Generated by: Amazon.com, Inc
    #
    # Generated on: 9/11/2018
    #
    
    @{
    
    # Script module or binary module file associated with this manifest.
    RootModule = 'AWSLambdaPSCore.psm1'
    
    # Version number of this module.
    ModuleVersion = '1.2.0.0'
    
    # Supported PSEditions
    CompatiblePSEditions = 'Core'
    
    # ID used to uniquely identify this module
    GUID = '79b7bff6-b031-4d8d-b17c-e7e11f1a741f'
    
    # Author of this module
    Author = 'Amazon.com, Inc'
    
    # Company or vendor of this module
    CompanyName = 'Amazon.com, Inc'
    
    # Copyright statement for this module
    Copyright = 'Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.'
    
    # Description of the functionality provided by this module
    Description = 'The AWS Lambda Tools for Powershell can be used to create and deploy AWS Lambda functions written in PowerShell.'
    
    # Minimum version of the PowerShell engine required by this module
    PowerShellVersion = '6.0'
    
    # Name of the PowerShell host required by this module
    # PowerShellHostName = ''
    
    # Minimum version of the PowerShell host required by this module
    # PowerShellHostVersion = ''
    
    # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
    # DotNetFrameworkVersion = ''
    
    # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
    # CLRVersion = ''
    
    # Processor architecture (None, X86, Amd64) required by this module
    # ProcessorArchitecture = ''
    
    # Modules that must be imported into the global environment prior to importing this module
    # RequiredModules = @()
    
    # Assemblies that must be loaded prior to importing this module
    # RequiredAssemblies = @()
    
    # Script files (.ps1) that are run in the caller's environment prior to importing this module.
    # ScriptsToProcess = @()
    
    # Type files (.ps1xml) to be loaded when importing this module
    # TypesToProcess = @()
    
    # Format files (.ps1xml) to be loaded when importing this module
    # FormatsToProcess = @()
    
    # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
    # NestedModules = @()
    
    # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
    FunctionsToExport = 'Get-AWSPowerShellLambdaTemplate', 'New-AWSPowerShellLambda', 
                   'New-AWSPowerShellLambdaPackage', 'Publish-AWSPowerShellLambda'
    
    # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
    CmdletsToExport = @()
    
    # Variables to export from this module
    # VariablesToExport = @()
    
    # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
    AliasesToExport = @()
    
    # DSC resources to export from this module
    # DscResourcesToExport = @()
    
    # List of all modules packaged with this module
    # ModuleList = @()
    
    # List of all files packaged with this module
    # FileList = @()
    
    # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
    PrivateData = @{
    
        PSData = @{
    
            # Tags applied to this module. These help with module discovery in online galleries.
            Tags = 'AWS','Lambda'
    
            # A URL to the license for this module.
            LicenseUri = 'https://github.com/aws/aws-lambda-dotnet/blob/master/LICENSE'
    
            # A URL to the main website for this project.
            ProjectUri = 'https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell'
    
            # A URL to an icon representing this module.
            IconUri = 'https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png'
    
            # ReleaseNotes of this module
            # ReleaseNotes = ''
    
            # Prerelease string of this module
            # Prerelease = ''
    
            # Flag to indicate whether the module requires explicit user acceptance for install/update
            # RequireLicenseAcceptance = $false
    
            # External dependent modules of this module
            # ExternalModuleDependencies = @()
    
        } # End of PSData hashtable
        
     } # End of PrivateData hashtable
    
    # HelpInfo URI of this module
    # HelpInfoURI = ''
    
    # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
    # DefaultCommandPrefix = ''
    
    }
    
    
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAzHksmnQ8Sx7Nl
    # M01ys7rf+b28QFp9h3UKK/9bv1h+KKCCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8BZTqudeakC1x5J
    # sTtNh/7CeKu/71KunK8I2TnlmlE+aV8wEE5xY2xY4fAgMxsPdL5byxLh24zEgJRy
    # u/ZFmp7BJQv7oxye2KYJcHHswEdMj33D3hnOPu4Eco4X0//wsgUyGUzTsByf/qV4
    # IEJwQbAmjG8AyDoAEUF6QbCnipEEoJl49He082Aq5mxQBLcUYP8NUfSoi4T+Idpc
    # Xn31KXlPsER0b21y/wIDAQABo4IBeDCCAXQwLgYIKwYBBQUHA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aaGTOlurWnJw3WjOFVeGTuX8J9llcgiTRlADWJhCo6IlYfhEucHJmJjQtGIV6q
    # 1BvAleW4oge2N29Lgp/CL8b4KuJl5s08yIy4BCuqfsBmZb8ALYxidBeoMjiQg1vl
    # JqGCAg8wggILBgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVT
    # MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
    # b20xITAfBgNVBAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr
    # 1tXq5hfwZjAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAc
    # BgkqhkiG9w0BCQUxDxcNMTkwMjA3MTg1MzA3WjAjBgkqhkiG9w0BCQQxFgQU+pjJ
    # Gt0IPBpdtQ1W3FbFckImTc0wDQYJKoZIhvcNAQEBBQAEggEAEfAa2xQF/9lfMVHU
    # sery/AjiidhrWqVVguSnHs7nEdB6Mct1LYiZ4Hs82U5gC2ni4Z6Q4HFQA0In9Ba1
    # uaCTW0gvy4Erph5Nbhzza59NceOGRIYzW2eQZe5VSl1M7BTCIGrNcMPvoKgasoV7
    # 9iDZ8yztAqsO3DwkIgXYeopSMuLdIdgo5hCAssLFGRjmiD+3cWLNodtn4yYh56AZ
    # cjJe/saFVAHp4/jkeDwgkPOL5UHFD9GVA4d3daA5tKBImFA+fExBRfAvyGptUmt0
    # lyam5a6rR2dPIm3ejGXMDXvbABfOIc2CjVbr16xFuiMHazroBNTJCW+ml63dODLK
    # 2EC4ow==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\AWSLambdaPSCore.psm1 Show
    $script:privatePath = Join-Path -Path $PSScriptRoot -ChildPath 'Private'
    $script:publicPath = Join-Path -Path $PSScriptRoot -ChildPath 'Public'
    $script:templatesPath = Join-Path -Path $PSScriptRoot -ChildPath 'Templates'
    
    
    # Add private functions
    # Hardcoded file names to ensure they load in an order to support pre-requisites
    $files = @(
        '_Constants.ps1',
        '_BlueprintFunctions.ps1',
        '_ArgumentCompleters.ps1',
        '_DeploymentFunctions.ps1',
        '_ProjectCreationFunctions.ps1'
    )
    foreach ($file in $files)
    {
        $filePath = Join-Path -Path $privatePath -ChildPath $file
        . $filePath
    }
    
    # Add public functions
    foreach ($file in (Get-ChildItem -Path $publicPath -Filter '*.ps1')) {
        . $file.FullName
    }
    
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDoRUBzH/oNzjuW
    # LIF5TgWwGmQ3r6unxfrINZBtMmr+DKCCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8BZTqudeakC1x5J
    # sTtNh/7CeKu/71KunK8I2TnlmlE+aV8wEE5xY2xY4fAgMxsPdL5byxLh24zEgJRy
    # u/ZFmp7BJQv7oxye2KYJcHHswEdMj33D3hnOPu4Eco4X0//wsgUyGUzTsByf/qV4
    # IEJwQbAmjG8AyDoAEUF6QbCnipEEoJl49He082Aq5mxQBLcUYP8NUfSoi4T+Idpc
    # Xn31KXlPsER0b21y/wIDAQABo4IBeDCCAXQwLgYIKwYBBQUHAQEEIjAgMB4GCCsG
    # AQUFBzAB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tWXHvVDQtBs+/s
    # dR90OPKyXGGinJXDUOSCuSPRujqGcq04eKx1XRcXNHJHhZRW0eu7NoR3zCSl8wQZ
    # Vann4+erYs37iy2QwsDStZS9Xk+xBdIOPRqpFFumhjFiqKgz5Js5p8T1zh14dpQl
    # c+Qqq8+cdkvtX8JLFuRLcEwAiR78xXm8TBJX/l/hHrwCXaj++wc4Tw3GXZG5D2dF
    # zdaD7eeSDY2xaYxP+1ngIw/Sqq4AfO6cQg7PkdcntxbuD8O9fAqg7iwIVYUiuOsY
    # Gk38KiGtSTGDR5V3cdyxG0tLHBCcdxTBnU8vWpUIKRAmMYIEXzCCBFsCAQEwgZkw
    # gYQxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEf
    # MB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazE1MDMGA1UEAxMsU3ltYW50
    # ZWMgQ2xhc3MgMyBTSEEyNTYgQ29kZSBTaWduaW5nIENBIC0gRzICECt3g4UAT0ym
    # kcB/NZDAe38wDQYJYIZIAWUDBAIBBQCggYQwGAYKKwYBBAGCNwIBDDEKMAigAoAA
    # oQKAADAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgorBgEEAYI3AgELMQ4w
    # DAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgX/GoLFOG8deOyAWvL/DVZbTk
    # 6tiUgVAo97SHqcZOmtQwDQYJKoZIhvcNAQEBBQAEggEAcEs2+745tmDwZr913mxy
    # toe/otRqgEACShCSoQ5ZP53cM0hxVM5hjyK3C1ROsS9I6LXt9AEEycHAr9mIXbS7
    # Qb3LCFvHXBdrrdcssnEeriFva+myujNoERA23jrHf5w9d6iR7W5qULyC+j75zsXH
    # faOm/nPLHzvS+qiJv7dlbR/6VqWih5aSngnXUi+wze8XKEji4nv5BasIMBNQsGbV
    # Z3gKVqwtIuA8gBIVHVszWlgQksjf1e5Im3uSoi+sx7L1dFyf3jMfBkBu8iS5llR9
    # yJVV4i2eVKTAgSnBWVECgjITEfleKJ/9zoMhc5+Im82fjuw0zgK1bMkKYdHlP69g
    # O6GCAg8wggILBgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVT
    # MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
    # b20xITAfBgNVBAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr
    # 1tXq5hfwZjAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAc
    # BgkqhkiG9w0BCQUxDxcNMTkwMjA3MTg1MzA4WjAjBgkqhkiG9w0BCQQxFgQU9IXb
    # 3AjfR1Cyjp00kr0cUe8JV/YwDQYJKoZIhvcNAQEBBQAEggEACyuHRAdvcz6l77Qm
    # R1HAGC7vYYtzA1iDAF+kmnl+pY00xOLya2J6E+2oRkA1naT/8UHSLojaAAZRltl0
    # 7cX5JJLC5jeNoUBXz4EhMnaNUNinOra32h2nnAxp1wGq7RrtWn6q//RV4AJVCvDl
    # WJSdHl4oUMSM8K/V2U4sJzP1lMDdD22hp/g6U1SX5Xp0dl7dtsVYh0gIkzRD/WHj
    # 85OMs5S5Cg7Qf6FBHoagLUJYy4y7+I/+9XYvmqF3HO0hwlfrKcuF8gVnZ9QGkqs3
    # Br+dheeA0UsUbuFme5D9ZbctFVVQuIxDGDuZv1Q11Y0/AVw5NfA8XaClYriEKhQO
    # bPlWEA==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\Private\_ArgumentCompleters.ps1 Show
    <#
        .DESCRIPTION
        Argument registration, allowing dynamic completion of the supported
        templates and other data
    #>
    function _argumentCompleterRegistration
    {
        param
        (
            # The script block that provider parameter completion
            [scriptblock]$scriptBlock,
    
            # Optional map restraining use of the scriptblock to designated
            # cmdlets
            [hashtable]$param2CmdletsMap
        )
    
        foreach ($paramName in $param2CmdletsMap.Keys)
        {
            $hash = @{
                ScriptBlock = $scriptBlock
                Parameter   = $paramName
            }
    
            $cmdletNames = $param2CmdletsMap[$paramName]
            if ($cmdletNames -And $cmdletNames.Length -gt 0)
            {
                $hash['Command'] = $cmdletNames
            }
    
            Register-ArgumentCompleter @hash -Verbose
        }
    }
    
    $PsTemplateCompleter = {
        param ($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
    
        $templateNameHash = @{ }
    
        $manifest = _loadBlueprintManifest
        foreach ($b in $manifest.blueprints)
        {
            $templateNameHash.Add($b.name, $b.description)
        }
    
        $templateNameHash.Keys.Where({$_ -like "$wordToComplete*"}) | Sort-Object | Foreach-Object {
            [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $templateNameHash[$_])
        }
    }
    
    $hashtable = @{ 'Template' = @('New-AWSPowerShellLambda') }
    _argumentCompleterRegistration -scriptBlock $PsTemplateCompleter -param2CmdletsMap $hashtable
    
    
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBnMLS4y0ih86h6
    # XcCkqpT9UgIX/OPbi3kupH4no3eyM6CCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8BZTqudeakC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    # OvxFDo2OFM3NV4FdbCSAlZnrwjgkNRXwj3nvPXISXdENeeHpIHArCOP3Q9mgW1be
    # t3abcw==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\Private\_BlueprintFunctions.ps1 Show
    $_blueprintsOnlinePath = '/LambdaSampleFunctions/powershell/v1/'
    $_modulePath = Split-Path -Path $PSScriptRoot -Parent
    $_blueprintsModulePath = Join-Path -Path $_modulePath -ChildPath 'Templates' -AdditionalChildPath 'Blueprints'
    $_manifestFilename = 'ps-lambda-blueprint-manifest.json'
    
    <#
        .DESCRIPTION
        Probes the default or custom location to find the requested blueprint content
    #>
    function _getHostedBlueprintsContent
    {
        param
        (
            # the relative path and filename to the content to load
            [Parameter(Mandatory = $true)]
            [string]$Contentpath
        )
    
        $_defaultOrigins = @(
            'https://d3rrggjwfhwld2.cloudfront.net'
            'https://aws-vs-toolkit.s3.amazonaws.com'
        )
        
        $_altOrigin = $env:PSLAMBDA_BLUEPRINTS_ORIGIN
    
        if ($_altOrigin)
        {
            $_contentOrigins = @($_altOrigin)
        }
        else
        {
            $_contentOrigins = $_defaultOrigins
        }
    
        foreach ($_origin in $_contentOrigins)
        {
            try
            {
                $_contentLocation = $_origin + $_blueprintsOnlinePath + $ContentPath
                Write-Debug "Attempting to load blueprints content at $_contentLocation"
                if ($_contentLocation.StartsWith('http'))
                {
                    # Preventing "-Verbose" from displaying Invoke-WebRequest verbose output
                    $response = Invoke-WebRequest -Uri $_contentLocation -Verbose:$false
                    $_content = [System.Text.Encoding]::UTF8.GetString($response.Content)
                    return $_content
                }
                else
                {
                    $_content = [System.IO.File]::ReadAllText($_contentLocation)
                    return $_content
                }
            }
            catch
            {
            }
        }
    }
    
    <#
        .DESCRIPTION
        Reads blueprint content from that installed with the module
    #>
    function _getLocalBlueprintsContent
    {
        param
        (
            # The relative path and filename to the content to load
            [Parameter(Mandatory = $true)]
            [string]$ContentPath
        )
    
        $_localContentPath = Join-Path -Path $_blueprintsModulePath -ChildPath $ContentPath
        Write-Debug "Attempting load of blueprint content from $_localContentPath"
        if (Test-Path -Path $_localContentPath -PathType Leaf)
        {
            return [System.IO.File]::ReadAllText($_localContentPath)
        }
        else
        {
            throw "$_localContentPath does not exist!"
        }
    }
    
    <#
        .DESCRIPTION
        Composite helper to obtain content from blueprints; if not available online
        it attempts to try from the local module install
    #>
    function _getBlueprintsContent
    {
        param
        (
            # the relative path and filename to the content to load
            [Parameter(Mandatory = $true)]
            [string]$ContentPath
        )
    
        $_content = _getHostedBlueprintsContent -Contentpath $ContentPath
        if (!($_content))
        {
            $_content = _getLocalBlueprintsContent -ContentPath $ContentPath
        }
    
        return $_content
    }
    
    <#
        .DESCRIPTION
        Loads the manifest and returns a PSObject of the content. Default
        behavior is to download from one of the online sources detailed in
        $_defaultOrigins. An alternative origin can be used by setting
        the PSLAMBDA_BLUEPRINTS_ORIGIN environment variable to a web or
        file-based location.
    #>
    function _loadBlueprintManifest
    {
        return ConvertFrom-Json -InputObject (_getBlueprintsContent -ContentPath $_manifestFilename)
    }
    
    <#
        .DESCRIPTION
        Unpacks one or more content files for a blueprint into the user-specified
        location. Returns the name of the script file containing the actual
        Lambda function to be run.
    #>
    function _unpackBlueprintContents
    {
        param
        (
            # The name of the template containing the content to be unpacked.
            [Parameter(Mandatory = $true)]
            [string]$Template,
    
            # The output folder to hold the content. It is created if necessary.
            [Parameter(Mandatory = $true)]
            [string]$Directory,
    
            # Basename to use for files in the blueprint that can be customized.
            # If not specified, the template name is used.
            [Parameter()]
            [string]$BaseName,
    
            # Optional script block that the unpacked script content will be passed to
            # prior to output to disk, allowing for template substitution etc.
            [Parameter()]
            [scriptblock]$ContentProcessor
        )
    
        $_manifest = _loadBlueprintManifest
    
        $_template = $_manifest.blueprints | Where-Object -Property name -EQ -Value $Template
        if (!($_template))
        {
            throw "Failed to find blueprint details for blueprint named $Template"
        }
    
        if (!(Test-Path $Directory))
        {
            New-Item -ItemType Directory -Path $Directory -Force | Out-Null
        }
    
        $_lambdaFunctionFile = ''
    
        # unpack the contents; for each file 'source' is the name of the content in the online or installed
        # payload, 'output' is the name we want the content to have on disk
        foreach ($_contentFile in $_template.content)
        {
            $_sourcePath = Join-Path -Path $Template -ChildPath $_contentFile.source
            $_outputFilename = $_contentFile.output.Replace('{basename}', $BaseName)
            $_outputPath = Join-Path -Path $Directory -ChildPath $_outputFilename
    
            Write-Debug "Loading blueprint content at $_sourcePath"
            $_content = _getBlueprintsContent -ContentPath $_sourcePath
    
            if ($ContentProcessor)
            {
                $fileExt = [System.IO.Path]::GetExtension($_outputFilename)
                $_content = Invoke-Command -ScriptBlock $ContentProcessor -ArgumentList $fileExt, $_content
            }
    
            Write-Debug "Writing output file $_outputPath"
            New-Item -ItemType File -Path $_outputPath -Force | Out-Null
            Out-File -FilePath $_outputPath -InputObject $_content -Encoding utf8NoBOM -Force | Out-Null
    
            if ($_contentFile.fileType -eq "lambdaFunction")
            {
                $_lambdaFunctionFile = $_outputFilename
            }
        }
    
        return $_lambdaFunctionFile
    }
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDw4AlrX+zDMzc6
    # XF0g1o5fgfFhDrxKKiQcpnyUiGUJpaCCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8B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nkWOaN
    # OPgdOY7iIbcu1RJdEECTmfa/vVuOfvcERQEOcjSRUzI9RWAca/46akPmVIajLsuN
    # eBp9Qg==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\Private\_Constants.ps1 Show
    if (!($DefaultFunctionMemory))
    {
        New-Variable -Name DefaultFunctionMemory -Value 512 -Option Constant
    }
    
    if (!($DefaultFunctionTimeout))
    {
        New-Variable -Name DefaultFunctionTimeout -Value 90 -Option Constant
    }
    
    if (!($ProjectModuleDirectory))
    {
        New-Variable -Name ProjectModuleDirectory -Value 'Modules' -Option Constant
    }
    
    if (!($AwsPowerShellFunctionEnvName))
    {
        New-Variable -Name AwsPowerShellFunctionEnvName -Value 'AWS_POWERSHELL_FUNCTION_HANDLER' -Option Constant
    }
    
    if (!($AwsPowerShellDefaultSdkVersion))
    {
        New-Variable -Name AwsPowerShellDefaultSdkVersion -Value '6.1.1' -Option Constant
    }
    
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCFq5GZuXX1h/49
    # aDOcB8ifyQllbpyIB3wlciSCmi8ONqCCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8BZTqudeakC1x5J
    # sTtNh/7CeKu/71KunK8I2TnlmlE+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VhlCML/1Z7GLAb/bDMskyJuh
    # Ddco8Q==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\Private\_DeploymentFunctions.ps1 Show
    function _deployProject
    {
        param
        (
            [Parameter(Mandatory = $true)]
            [string]$FunctionName,
    
            [Parameter(Mandatory = $false)]
            [string]$FunctionHandler,
    
            [Parameter(Mandatory = $false)]
            [string]$PowerShellFunctionHandler,
    
            [Parameter(Mandatory = $false)]
            [string]$ProfileName,
    
            [Parameter(Mandatory = $false)]
            [string]$Region,
    
            [Parameter(Mandatory = $false)]
            [string]$FunctionRole,
    
            [Parameter(Mandatory = $false)]
            [int]$FunctionMemory,
    
            [Parameter(Mandatory = $false)]
            [int]$FunctionTimeout,
    
            [Parameter(Mandatory = $false)]
            [Boolean]$PublishNewVersion,
    
            [Parameter(Mandatory = $false)]
            [Hashtable]$EnvironmentVariables,
    
            [Parameter(Mandatory = $false)]
            [string]$KmsKeyArn,
    
            [Parameter(Mandatory = $false)]
            [string[]]$FunctionSubnets,
    
            [Parameter(Mandatory = $false)]
            [string[]]$FunctionSecurityGroups,
    
            [Parameter(Mandatory = $false)]
            [string]$DeadLetterQueueArn,
    
            [Parameter(Mandatory = $false)]
            [string]$TracingMode,
    
            [Parameter(Mandatory = $false)]
            [string]$S3Bucket,
    
            [Parameter(Mandatory = $false)]
            [string]$S3KeyPrefix,
    
            [Parameter(Mandatory = $false)]
            [Hashtable]$Tags,
    
            [Parameter(Mandatory = $false)]
            [Boolean]$DisableInteractive,
    
            [Parameter(Mandatory = $false)]
            [string]$BuildDirectory
        )
    
        _validateDotnetInstall
    
        if ($BuildDirectory)
        {
            Push-Location $BuildDirectory
        }
    
        try
        {
            $arguments = '"{0}"' -f $FunctionName
            $arguments += ' --configuration Release --framework netcoreapp2.1 --function-runtime dotnetcore2.1'
    
            $arguments += ' '
            $arguments += _setupAWSCredentialsCliArguments -ProfileName $ProfileName
            $arguments += ' '
            $arguments += _setupAWSRegionCliArguments -Region $Region
    
            if (($FunctionHandler))
            {
                $arguments += " --function-handler $FunctionHandler"
            }
    
            if (($FunctionRole))
            {
                $arguments += " --function-role $FunctionRole"
            }
    
            if (($FunctionMemory))
            {
                $arguments += " --function-memory-size $FunctionMemory"
            }
    
            if (($FunctionTimeout))
            {
                $arguments += " --function-timeout $FunctionTimeout"
            }
    
            if (($PublishNewVersion))
            {
                $arguments += ' --function-publish true'
            }
    
            if ($PowerShellFunctionHandler)
            {
                $arguments += ' --append-environment-variables "{0}={1}"' -f $AwsPowerShellFunctionEnvName, $PowerShellFunctionHandler
                Write-Host "Setting the $AwsPowerShellFunctionEnvName environment variable to $PowerShellFunctionHandler to identify the PowerShell function to call"
            }
    
            $formattedEnvironmentVariables = _formatHashTable($EnvironmentVariables)
            if (($formattedEnvironmentVariables))
            {
                $arguments += ' --environment-variables "{0}"' -f $formattedEnvironmentVariables
            }
    
            if (($KmsKeyArn))
            {
                $arguments += " --kms-key $KmsKeyArn"
            }
    
            $formattedSubnets = _formatArray($FunctionSubnets)
            if (($formattedSubnets))
            {
                $arguments += " --function-subnets $formattedSubnets"
            }
    
            $formattedSecurityGroups = _formatArray($FunctionSecurityGroups)
            if (($formattedSecurityGroups))
            {
                $arguments += " --function-security-groups $formattedSecurityGroups"
            }
    
            if (($DeadLetterQueueArn))
            {
                $arguments += " --dead-letter-target-arn $DeadLetterQueueArn"
            }
    
            if (($TracingMode))
            {
                $arguments += " --tracing-mode $TracingMode"
            }
    
            if (($S3Bucket))
            {
                $arguments += " --s3-bucket $S3Bucket"
            }
    
            if (($S3KeyPrefix))
            {
                $arguments += " --s3-prefix $S3KeyPrefix"
            }
    
            $formattedTags = _formatHashTable($Tags)
            if (($formattedTags))
            {
                $arguments += ' --tags "{0}"' -f $formattedTags
            }
    
            if (($DisableInteractive))
            {
                $arguments += ' --disable-interactive true'
            }
    
            $amazonLambdaToolsPath = _configureAmazonLambdaTools
            
            $env:AWS_EXECUTION_ENV="AWSLambdaPSCore"
            try 
            {
                if ($DisableInteractive) 
                {
                    Invoke-Expression "$amazonLambdaToolsPath deploy-function $arguments" | Foreach-Object {Write-Verbose -Message "$_`r"}
                }
                else
                {
                    Write-Host 'Initiate deployment'
                    Invoke-Expression "$amazonLambdaToolsPath deploy-function $arguments"            
                }                
            }
            finally 
            {
                Remove-Item Env:\AWS_EXECUTION_ENV
            }
    
            if ($LASTEXITCODE -ne 0)
            {
                $msg = @"
    Error publishing PowerShell Lambda Function: $LastExitCode
    CALLSTACK:$(Get-PSCallStack | Out-String)
    "@
                throw $msg
            }
        }
        finally
        {
            Pop-Location
        }
    }
    
    
    function _packageProject
    {
        param
        (
            [Parameter(Mandatory = $true)]
            [string]$OutputPackage,
    
            [Parameter(Mandatory = $false)]
            [string]$BuildDirectory
        )
    
        _validateDotnetInstall
    
        if (($BuildDirectory))
        {
            Push-Location $BuildDirectory
        }
        try
        {
            $arguments = $Name
            $arguments += ' --configuration Release --framework netcoreapp2.1 --function-runtime dotnetcore2.1'
    
            if (($OutputPackage))
            {
                $arguments += " --output-package $OutputPackage"
            }
            $amazonLambdaToolsPath = _configureAmazonLambdaTools
    
            Write-Host 'Initiate packaging'
    
            # All output from the function deployment is sent to the verbose stream to allow user controlled access
            # to this level of detail
            Write-Verbose -Message "$amazonLambdaToolsPath package $arguments"
            Invoke-Expression "$amazonLambdaToolsPath package $arguments" | Foreach-Object {Write-Verbose -Message "$_`r"}
            if ($LASTEXITCODE -ne 0)
            {
                $msg = @"
    Error publishing PowerShell Lambda Function: $LastExitCode
    CALLSTACK:$(Get-PSCallStack | Out-String)
    "@
                throw $msg
            }
        }
        finally
        {
            Pop-Location
        }
    }
    
    function _setupAWSCredentialsCliArguments
    {
        param
        (
            [string]$ProfileName
        )
    
        if ($ProfileName)
        {
            return "--profile $ProfileName"
        }
    
        # Look to see if the AWSPowerShell.NetCore module is loaded and that it was used to configure credentials for the shell.
        # If it has then pass those credentials into the Lambda dotnet CLI tool.
        if (Get-Command 'Get-AWSCredentials' -ErrorAction SilentlyContinue)
        {
            $shellCredentials = Get-AWSCredentials
            if ($shellCredentials)
            {
                $realCreds = $shellCredentials.GetCredentials()
                Write-Verbose -Message 'Using aws credentials configured for the hosting shell'
                $arguments = '--aws-access-key-id {0} --aws-secret-key {1}' -f $realCreds.AccessKey, $realCreds.SecretKey
    
                if ($realCreds.UseToken)
                {
                    Write-Verbose -Message 'Using session token'
                    $arguments += ' --aws-session-token {0}' -f $realCreds.Token
                }
    
                return $arguments
            }
        }
    
        return [String]::Empty
    }
    
    function _setupAWSRegionCliArguments
    {
        param
        (
            [string]$Region
        )
    
        if ($Region)
        {
            return "--region $Region"
        }
    
        if (Get-Command 'Get-DefaultAWSRegion' -ErrorAction SilentlyContinue)
        {
            $shellRegion = Get-DefaultAWSRegion
            if ($shellRegion)
            {
                Write-Verbose -Message ('Using region {0} configured for the hosting shell' -f $shellRegion.Region)
                return '--region {0}' -f $shellRegion.Region
            }
        }
    
        return [String]::Empty
    }
    
    function _configureAmazonLambdaTools
    {
        Write-Host 'Restoring .NET Lambda deployment tool'
    
        Write-Verbose -Message 'Installing .NET Global Tool Amazon.Lambda.Tools'
    
        # When "-Verbose" switch was used this output was not hidden.
        # Using stream redirection to force hide all output from the dotnet cli call
        & dotnet tool install -g Amazon.Lambda.Tools *>&1 | Out-Null
    
        if ($LASTEXITCODE -ne 0)
        {
            Write-Verbose -Message 'Error installing, attempting to update Amazon.Lambda.Tools'
    
            # When "-Verbose" switch was used this output was not hidden.
            # Using stream redirection to force hide all output from the dotnet cli call
            & dotnet tool update -g Amazon.Lambda.Tools *>&1 | Out-Null
    
            if ($LASTEXITCODE -ne 0)
            {
                $msg = @"
    Error configuring .NET CLI AWS Lambda deployment tools: $LastExitCode
    CALLSTACK:$(Get-PSCallStack | Out-String)
    "@
                throw $msg
            }
        }
    
        $toolsFolder = Join-Path -Path '~' -ChildPath '.dotnet' -AdditionalChildPath 'tools'
    
        $amazonLambdaToolsPath = Join-Path -Path $toolsFolder -ChildPath 'dotnet-lambda.exe'
        Write-Verbose -Message 'Looking for windows excutable for dotnet-lambda.exe'
        if (!(Test-Path -Path $amazonLambdaToolsPath))
        {
            Write-Verbose -Message 'Did not find windows executable, assuming on non windows platform and using dotnet-lambda'
            $amazonLambdaToolsPath = Join-Path -Path $toolsFolder -ChildPath 'dotnet-lambda'
        }
    
        return $amazonLambdaToolsPath
    }
    
    function _formatHashTable
    {
        param
        (
            [Parameter(Mandatory = $false)]
            [Hashtable]$Table
        )
    
        if (!($Table) -or $Table.Count -eq 0)
        {
            return $null
        }
    
        $sb = [System.Text.StringBuilder]::new()
    
        $Table.Keys | ForEach-Object {
            if ($sb.Length -ne 0)
            {
                $sb.Append(";") | Out-Null
            }
    
            $sb.AppendFormat('{0}={1}', $_, $Table[$_]) | Out-Null
        }
    
        return $sb.ToString()
    }
    
    function _formatArray
    {
        param
        (
            [Parameter(Mandatory = $false)]
            [string[]]$Items
        )
    
        if (!($Items) -or $Items.Count -eq 0)
        {
            return $null
        }
    
        $sb = [System.Text.StringBuilder]::new()
    
        $items | ForEach-Object {
            if ($sb.Length -ne 0)
            {
                $sb.Append(",") | Out-Null
            }
            $sb.Append($_) | Out-Null
        }
    
        return $sb.ToString()
    }
    
    function _prepareDependentPowerShellModules
    {
        param
        (
            [Parameter(Mandatory = $true)]
            [string]$Script,
    
            [Parameter(Mandatory = $true)]
            [string]$ProjectDirectory,
    
            [Parameter(Mandatory = $true)]
            [bool]$ClearExisting,
    
            [Parameter()]
            [string[]]$ModuleRepository
        )
    
        $SavedModulesDirectory = Join-Path -Path $ProjectDirectory -ChildPath $ProjectModuleDirectory
        if ($ClearExisting -and (Test-Path -Path $SavedModulesDirectory))
        {
            Remove-Item -Path $SavedModulesDirectory -Recurse -Force
        }
    
        if (!(Test-Path -Path $SavedModulesDirectory))
        {
            New-Item -ItemType directory -Path $SavedModulesDirectory | Out-Null
        }
    
        $ast = [System.Management.Automation.Language.Parser]::ParseFile($Script, [ref]$null, [ref]$null)
        if ($ast.ScriptRequirements.RequiredModules)
        {
            $ast.ScriptRequirements.RequiredModules | ForEach-Object -Process {
    
                if ($_.Name -ieq 'AWSPowerShell')
                {
                    Write-Warning 'This script requires the AWSPowerShell module which is not supported. Please change the #Requires statement to AWSPowerShell.NetCore which is the "Core" platform edition of the AWS CmdLets. You are also required to install the AWSPowerShell.NetCore module if it is required.'
    
                    Write-Warning 'To use the AWS CmdLets execute "Install-Module AWSPowerShell.NetCore" and then update the #Requires statement to the version installed. If you are not going to use the AWS CmdLets then remove the #Requires statement from the script.'
    
                    throw 'The AWSPowerShell Module is not supported. Change the #Requires statement to reference the AWSPowerShell.NetCore module instead.'
                }
    
                $localModule = _findLocalModule -Name $_.Name -Version $_.Version
                if ($localModule)
                {
                    Write-Host ('Copying local module {0}({1}) from {2}' -f $localModule.Name, $localModule.Version, $localModule.ModuleBase)
                    $copyPath = Join-Path -Path $SavedModulesDirectory -ChildPath $localModule.Name -AdditionalChildPath $localModule.Version.ToString()
                    if (!(Test-Path -Path $copyPath))
                    {
                        New-Item -ItemType directory -Path $copyPath | Out-Null
                    }
                    Copy-Item -Path (Join-Path -Path $localModule.ModuleBase -ChildPath '*') -Destination $copyPath -Recurse
                }
                else
                {
                    $splat = @{
                        Name = $_.Name
                        Path = $SavedModulesDirectory
                        ErrorAction = 'Stop'
                    }
                    
                    if ($_.Version)
                    {
                        $splat.Add('RequiredVersion',$_.Version)
                    }
                    
                    if ($ModuleRepository)
                    {
                        $splat.Add('Repository',$ModuleRepository)
                    }
                    
                    # in the Save-Module call, replace -RequiredVersion with @splat
                    Save-Module @splat
                }
            }
        }
    }
    
    function _findLocalModule
    {
        param
        (
            [Parameter(Mandatory = $true)]
            [string]$Name,
    
            [Parameter()]
            [Version]$Version
        )
    
        $loadedModule = Get-Module -Name $Name
        if ($loadedModule -and ($Version -eq $null -or $Version -eq $loadedModule.Version))
        {
            $message = 'Found imported module {0} ({1}) to save with package bundle.' -f $loadedModule.Name, $loadedModule.Version.ToString()
            Write-Verbose -Message $message
            return $loadedModule
        }
    
        $availableModules = Get-Module -ListAvailable -Name $Name | Sort-Object -Property Version -Descending
        
        # Select-Object added to ensure multiple installed copies of a specified version won't break staging folder
        # names. Before: ModuleName\System.Obejct[]\. After: Module\Version\
        $availableModules | ForEach-Object -Process {
            if ($null -eq $Version -or $_.Version -eq $Version)
            {
                $message = 'Found installed module {0} ({1}) to save with package bundle.' -f $_.Name, $_.Version.ToString()
                Write-Verbose -Message $message
                return $_
            }
        } | Select-Object -First 1
    
        return $null
    }
    
    function _validateDotnetInstall
    {
        $application = Get-Command -Name dotnet
        if (!($application))
        {
            throw '.NET Core 2.1 SDK was not found which is required to build the PowerShell Lambda package bundle. Download the .NET Core 2.1 SDK from https://www.microsoft.com/net/download'
        }
    
        $minVersion = [System.Version]::Parse('2.1.300')
        $foundMin = $false
    
        $installedSDKs = & dotnet --list-sdks
        foreach ($sdk in $installedSDKs) {
            $foundVersion = $sdk.split(' ')[0]
            $version = [System.Version]::new()
            if ([System.Version]::TryParse($foundVersion, [ref]$version))
            {
                if ($minVersion -le $foundVersion)
                {
                    $foundMin = $true
                }
            }
        }
    
        if (!($foundMin))
        {
            throw 'The installed .NET Core SDK does not meet the minimum requirement to build the PowerShell Lambda package bundle. Download the .NET Core 2.1 SDK from https://www.microsoft.com/net/download'
        }
    }
    
    function _createStagingDirectory
    {
        param
        (
            [Parameter(Mandatory = $true)]
            [String]$Name,
    
            [Parameter(Mandatory = $false)]
            [String]$StagingDirectory
        )
        
        if ($StagingDirectory)
        {
            $NewStagingDirectory = Join-Path -Path $StagingDirectory -ChildPath $Name
        }
        else
        {
            $NewStagingDirectory = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath $Name
        }
    
        if (Test-Path -Path $NewStagingDirectory)
        {
            Write-Verbose -Message 'Removing previous staging directory'
            Remove-Item -Path $NewStagingDirectory -Recurse -Force
        }
    
        Write-Host "Staging deployment at $NewStagingDirectory"
        New-Item -ItemType Directory -Path $NewStagingDirectory -Force | Out-Null
    
        return $NewStagingDirectory
    }
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB3m2umKLWLU+Z6
    # R0SgrozC6PaOH67F6Xn9MSfvkNvPVqCCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8BZTqudeakC1x5J
    # sTtNh/7CeKu/71KunK8I2TnlmlE+aV8wEE5xY2xY4fAgMxsPdL5byxLh24zEgJRy
    # u/ZFmp7BJQv7oxye2KYJcHHswEdMj33D3hnOPu4Eco4X0//wsgUyGUzTsByf/qV4
    # IEJwQbAmjG8AyDoAEUF6QbCnipEEoJl49He082Aq5mxQBLcUYP8NUfSoi4T+Idpc
    # Xn31KXlPsER0b21y/wIDAQABo4IBeDCCAXQwLgYIKwYBBQUHAQEEIjAgMB4GCCsG
    # AQUFBzABhhJodHRwOi8vcy5zeW1jZC5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADBm
    # BgNVHSAEXzBdMFsGC2CGSAGG+EUBBxcDMEwwIwYIKwYBBQUHAgEWF2h0dHBzOi8v
    # ZC5zeW1jYi5jb20vY3BzMCUGCCsGAQUFBwICMBkaF2h0dHBzOi8vZC5zeW1jYi5j
    # b20vcnBhMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9zLnN5bWN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WgBQVABIrE5iymQftHt+ivlcNK2cCzTAdBgNVHQ4EFgQU
    # YVpNJLZJMp1KKnkag0v0HonByn0wfQYDVR0fBHYwdDA4oDagNIYyaHR0cDovL2Ny
    # bDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0QXNzdXJlZElEQ0EtMS5jcmwwOKA2oDSG
    # Mmh0dHA6Ly9jcmw0LmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEFzc3VyZWRJRENBLTEu
    # Y3JsMHcGCCsGAQUFBwEBBGswaTAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGln
    # aWNlcnQuY29tMEEGCCsGAQUFBzAChjVodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5j
    # b20vRGlnaUNlcnRBc3N1cmVkSURDQS0xLmNydDANBgkqhkiG9w0BAQUFAAOCAQEA
    # nSV+GzNNsiaBXJuGziMgD4CH5Yj//7HUaiwx7ToXGXEXzakbvFoWOQCd42yE5FpA
    # +94GAYw3+puxnSR+/iCkV61bt5qwYCbqaVchXTQvH3Gwg5QZBWs1kBCge5fH9j/n
    # 4hFBpr1i2fAnPTgdKG86Ugnw7HBi02JLsOBzppLA044x2C/jbRcTBu7kA7YUq/OP
    # Q6dxnSHdFMoVXZJB2vkPgdGZdA0mxA5/G7X1oPHGdwYoFenYk+VVFvC7Cqsc21xI
    # J2bIo4sKHOWV2q7ELlmgYd3a822iYemKC23sEhi991VUQAOSK2vCUcIKSK+w1G7g
    # 9BQKOhvjjz3Kr2qNe9zYRDCCBs0wggW1oAMCAQICEAb9+QOWA63qAArrPye7uhsw
    # DQYJKoZIhvcNAQEFBQAwZTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0
    # IEluYzEZMBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTEkMCIGA1UEAxMbRGlnaUNl
    # cnQgQXNzdXJlZCBJRCBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTIxMTExMDAw
    # MDAwMFowYj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xITAfBgNVBAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr
    # 1tXq5hfwZjAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAc
    # BgkqhkiG9w0BCQUxDxcNMTkwMjA3MTg1MzExWjAjBgkqhkiG9w0BCQQxFgQUrXsf
    # ZYHQmflYxeDfCuAFwiPXV78wDQYJKoZIhvcNAQEBBQAEggEASPQPmD0kcI9ewE4I
    # uy6Vwe8Ic7QJsuRjigQGkb2jH34t6kLCYNLEnAT5EN+aOtQfLvqAVLlJv2YzfFf2
    # ka3LXirLQ+H85bmi+quGbEX60rGblzYwLU2cBwFwHXlaE5vGWrzXTLr4dUKMyxdg
    # JadoI1dFpRrjvWYFqNdFi300i8cUUiT0Vyb4QxkSHixbLRMq1eXm4oSQllOW/Vz9
    # PNcjd3ccXtjD1I5D/+hHjBKxSrG6634hZ4aUrU+BKTTdmsyXO8yjTC+BbfT2ybP8
    # +KP26q/zKdFL2M7lNqDU1XGXxr3JIjXets+gPtBMBUk0+r5zXo4E9t6vkDBKs6Ss
    # O6Yb+g==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\Private\_ProjectCreationFunctions.ps1 Show
    <#
        .DESCRIPTION
        Initializes the PowerShell script file containing our Lambda function from the
        blueprint contents. The name of the script file containing the function is
        returned to the caller, to be used in further initialization of the unpacked
        blueprint (eg when adding the wrapper project files).
    #>
    function _initializeScriptFromTemplate
    {
        param
        (
            # The name of the template to source the new script or project based Lambda function from.
            [Parameter(Mandatory = $true)]
            [string]$Template,
    
            # The output folder to place the generated content into.
            [Parameter(Mandatory = $true)]
            [string]$Directory,
    
            # Optional basename to use for the Lambda function script file. If not specified the
            # name of the template is used.
            [Parameter()]
            [string]$BaseName
        )
    
        if ($BaseName)
        {
            $_baseName = $BaseName
        }
        else
        {
            $_baseName = $Template
        }
    
        $_lambdaFunctionFile = _unpackBlueprintContents -Template $Template -Directory $Directory -BaseName $_baseName -ContentProcessor {
    
            param([string]$fileExt, [string]$content)
    
            if (($fileExt -ieq '.ps1') -Or ($fileExt -ieq '.psm1'))
            {
                # Check to see if the script has stated a requirement on AWSPowerShell.NetCore and if so make the
                # version referenced match the version installed locally.
                $ast = [System.Management.Automation.Language.Parser]::ParseInput($content, [ref]$null, [ref]$null)
                if ($ast.ScriptRequirements.RequiredModules)
                {
                    $ast.ScriptRequirements.RequiredModules | ForEach-Object  -Process {
    
                        if (!($_.Name -ieq 'AWSPowerShell.NetCore'))
                        {
                            return
                        }
    
                        $installedVersion = _getVersionOfLocalInstalledModule -Module $_.Name
                        if (!($installedVersion))
                        {
                            Write-Warning 'This script requires the AWSPowerShell.NetCore module which is not installed locally.'
                            Write-Warning 'To use the AWS CmdLets execute "Install-Module AWSPowerShell.NetCore" and then update the #Requires statement to the version installed. If you are not going to use the AWS CmdLets then remove the #Requires statement from the script.'
                        }
                        elseif ($installedVersion -ne $_.Version.ToString())
                        {
                            $lines = $content.Split('\n')
                            for ($i = 0; $i -lt $lines.Length; $i++ )
                            {
                                if ($lines[$i].Contains('#Requires') -and $lines[$i].Contains($_.Name) -and $lines[$i].Contains($_.Version.ToString()) )
                                {
                                    $lines[$i] = $lines.Replace($_.Version.ToString(), $installedVersion)
                                    Write-Host ("Configuring script to use installed version $installedVersion of AWSPowerShell.NetCore.")
                                    break
                                }
                            }
    
                            $content = [System.String]::Join('\n', $lines)
                        }
                    }
                }
            }
    
            return $content
        }
    
        return $_lambdaFunctionFile
    }
    
    # Checks for an already installed dependency module and returns the version if found.
    function _getVersionOfLocalInstalledModule
    {
        param
        (
            [Parameter(Mandatory = $true)]
            [string]$Module
        )
    
        $localModule = Get-Module -ListAvailable -Name $Module | Sort-Object -Property Version -Descending | Select-Object -First 1
        if ($localModule)
        {
            $localModule.Version.ToString()
        }
    }
    
    function _addPowerShellLambdaProjectContent
    {
        param
        (
            # The name the user selected for the project, or the template name if the user
            # did not supply a value.
            [Parameter()]
            [string]$ProjectName,
    
            # The name of the generated file containing the actual Lambda function.
            [Parameter()]
            [string]$ScriptFile,
    
            # The output folder containing the generated project.
            [Parameter()]
            [string]$Directory,
    
            # User-specified credential profile name to seed into the generated defaults file to be used on deployment.
            [Parameter()]
            [string]$ProfileName,
    
            # User-specified region to seed into the generated defaults file to be used on deployment.
            [Parameter()]
            [string]$Region,
    
            # The version of Microsoft.PowerShell.SDK to configure for the project
            [Parameter()]
            [string]$PowerShellSdkVersion,
    
            [Parameter(Mandatory = $true)]
            [bool]$QuietMode
        )
    
        if(!($PowerShellSdkVersion)) 
        {
            $PowerShellSdkVersion = $AwsPowerShellDefaultSdkVersion
        }
    
        # Setup project file
        $csprojContent = _getBlueprintsContent 'projectfile.csproj.txt'
        $csprojContent = $csprojContent.Replace('SCRIPT_FILE', $ScriptFile)
        $csprojContent = $csprojContent.Replace('POWERSHELL_SDK_VERSION', $PowerShellSdkVersion)
    
        Write-Host "Configuring PowerShell to version $PowerShellSdkVersion"
    
        $filename = Join-Path -Path $Directory -ChildPath "$ProjectName.csproj"
        if (!$QuietMode)
        {
            Write-Host "Generating C# project $filename used to create Lambda function bundle."
        }
        Out-File -FilePath $filename -InputObject $csprojContent -Encoding UTF8 -Force
    
        # Setup bootstrap code
        $namespaceName = _makeSafeNamespaceName ([System.IO.Path]::GetFileName($ProjectName))
    
        $bootstrapContent = _getBlueprintsContent 'bootstrap.cs.txt'
        $bootstrapContent = $bootstrapContent.Replace('NAMESPACE_NAME', $namespaceName)
        $bootstrapContent = $bootstrapContent.Replace('SCRIPT_FILE', $ScriptFile)
    
        $filename = Join-Path -Path $Directory -ChildPath 'Bootstrap.cs'
        if (!$QuietMode)
        {
            Write-Host "Generating $filename to load PowerShell script and required modules in Lambda environment."
        }
        Out-File -FilePath $filename -InputObject $bootstrapContent -Encoding UTF8 -Force
    
        if (!$QuietMode)
        {
            Write-Host 'Generating aws-lambda-tools-defaults.json config file with default values used when publishing project.'
        }
    
        $defaultsContent = _getBlueprintsContent 'aws-lambda-tools-defaults.txt'
        $defaultsContent = $defaultsContent.Replace('CONFIGURED_PROFILE', $ProfileName)
        $defaultsContent = $defaultsContent.Replace('CONFIGURED_REGION', $Region)
        $defaultsContent = $defaultsContent.Replace('PROJECT_NAME', $ProjectName)
        $defaultsContent = $defaultsContent.Replace('DEFAULT_MEMORY', $DefaultFunctionMemory)
        $defaultsContent = $defaultsContent.Replace('DEFAULT_TIMEOUT', $DefaultFunctionTimeout)
    
        $filename = Join-Path -Path $Directory -ChildPath 'aws-lambda-tools-defaults.json'
        Out-File -FilePath $filename -InputObject $defaultsContent -Encoding UTF8 -Force
    
        $newDirectory = Join-Path -Path $Directory -ChildPath $ProjectModuleDirectory
        New-Item -ItemType directory -Path $newDirectory -Force | Out-Null
    }
    
    
    function _makeSafeNamespaceName
    {
        param
        (
            [Parameter(Mandatory = $true)]
            [string]$OriginalName
        )    
    
        $namespaceName = $OriginalName
        $namespaceName = $namespaceName -replace '-', '_'
        $namespaceName = $namespaceName -replace ' ', '_'
        $namespaceName = $namespaceName -replace '\.', '_'
        if([Char]::IsDigit($namespaceName[0]))
        {
            $namespaceName = "PS_$namespaceName"
        }    
    
        return $namespaceName
    }
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCD7TSLdsL3wIlg0
    # 8gjF/EXNFRjRlvpwN6yk58zbdzOWtqCCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8BZTqudeakC1x5J
    # sTtNh/7CeKu/71KunK8I2TnlmlE+aV8wEE5xY2xY4fAgMxsPdL5byxLh24zEgJRy
    # u/ZFmp7BJQv7oxye2KYJcHHswEdMj33D3hnOPu4Eco4X0//wsgUyGUzTsByf/qV4
    # IEJwQbAmjG8AyDoAEUF6QbCnipEEoJl49He082Aq5mxQBLcUYP8NUfSoi4T+Idpc
    # Xn31KXlPsER0b21y/wIDAQABo4IBeDCCAXQwLgYIKwYBBQUHAQEEIjAgMB4GCCsG
    # AQUFBzABhhJodHRwOi8vcy5zeW1jZC5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADBm
    # BgNVHSAEXzBdMFsGC2CGSAGG+EUBBxcDMEwwIwYIKwYBBQUHAgEWF2h0dHBzOi8v
    # ZC5zeW1jYi5jb20vY3BzMCUGCCsGAQUFBwICMBkaF2h0dHBzOi8vZC5zeW1jYi5j
    # b20vcnBhMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9zLnN5bWNiLmNvbS91bml2
    # ZXJzYWwtcm9vdC5jcmwwEwYDVR0lBAwwCgYIKwYBBQUHAwMwDgYDVR0PAQH/BAQD
    # AgEGMCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFTeW1hbnRlY1BLSS0xLTcyNDAd
    # BgNVHQ4EFgQU1MAGIknrOUvdk+JcobhHdglyA1gwHwYDVR0jBBgwFoAUtnf6aUhH
    # n1MS1cLqBzJ2B9GXBxkwDQYJKoZIhvcNAQELBQADggEBAH/ryqfqi3ZC6z6OIFQw
    # 47e53PpIPhbHD0WVEM0nhqNm8wLtcfiqwlWXkXCD+VJ+Umk8yfHglEaAGLuh1KRW
    # pvMdAJHVhvNIh+DLxDRoIF60y/kF7ZyvcFMnueg+flGgaXGL3FHtgDolMp9Er25D
    # KNMh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yu+GQBgXzDR3hr2PlZahRi+SrDD9X
    # w8tfbAjix7qbdAEIUKGASmAi9wRnvrvrGzAIpBKNA+kuP0F9gS0iwdOUvTx3h/98
    # 2PVaKQNO77YBiYaIfihFiLFGFpIZvE+wvu+/ZBijhccj6PR6HqkHnbJ2O2xfN8D5
    # RfXk3g==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\PSGetModuleInfo.xml Show
    <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
      <Obj RefId="0">
        <TN RefId="0">
          <T>Microsoft.PowerShell.Commands.PSRepositoryItemInfo</T>
          <T>System.Management.Automation.PSCustomObject</T>
          <T>System.Object</T>
        </TN>
        <MS>
          <S N="Name">AWSLambdaPSCore</S>
          <S N="Version">1.2.0.0</S>
          <S N="Type">Module</S>
          <S N="Description">The AWS Lambda Tools for Powershell can be used to create and deploy AWS Lambda functions written in PowerShell.</S>
          <S N="Author">Amazon.com Inc</S>
          <S N="CompanyName">aws-dotnet-sdk-team</S>
          <S N="Copyright">Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.</S>
          <DT N="PublishedDate">2019-02-07T19:26:20+00:00</DT>
          <Nil N="InstalledDate" />
          <Nil N="UpdatedDate" />
          <URI N="LicenseUri">https://github.com/aws/aws-lambda-dotnet/blob/master/LICENSE</URI>
          <URI N="ProjectUri">https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell</URI>
          <URI N="IconUri">https://sdk-for-net.amazonwebservices.com/images/AWSLogo128x128.png</URI>
          <Obj N="Tags" RefId="1">
            <TN RefId="1">
              <T>System.Object[]</T>
              <T>System.Array</T>
              <T>System.Object</T>
            </TN>
            <LST>
              <S>AWS</S>
              <S>Lambda</S>
              <S>PSModule</S>
              <S>PSEdition_Core</S>
            </LST>
          </Obj>
          <Obj N="Includes" RefId="2">
            <TN RefId="2">
              <T>System.Collections.Hashtable</T>
              <T>System.Object</T>
            </TN>
            <DCT>
              <En>
                <S N="Key">Function</S>
                <Obj N="Value" RefId="3">
                  <TNRef RefId="1" />
                  <LST>
                    <S>Get-AWSPowerShellLambdaTemplate</S>
                    <S>New-AWSPowerShellLambda</S>
                    <S>New-AWSPowerShellLambdaPackage</S>
                    <S>Publish-AWSPowerShellLambda</S>
                  </LST>
                </Obj>
              </En>
              <En>
                <S N="Key">RoleCapability</S>
                <Obj N="Value" RefId="4">
                  <TNRef RefId="1" />
                  <LST />
                </Obj>
              </En>
              <En>
                <S N="Key">Command</S>
                <Obj N="Value" RefId="5">
                  <TNRef RefId="1" />
                  <LST>
                    <S>Get-AWSPowerShellLambdaTemplate</S>
                    <S>New-AWSPowerShellLambda</S>
                    <S>New-AWSPowerShellLambdaPackage</S>
                    <S>Publish-AWSPowerShellLambda</S>
                  </LST>
                </Obj>
              </En>
              <En>
                <S N="Key">DscResource</S>
                <Obj N="Value" RefId="6">
                  <TNRef RefId="1" />
                  <LST />
                </Obj>
              </En>
              <En>
                <S N="Key">Workflow</S>
                <Obj N="Value" RefId="7">
                  <TNRef RefId="1" />
                  <LST />
                </Obj>
              </En>
              <En>
                <S N="Key">Cmdlet</S>
                <Obj N="Value" RefId="8">
                  <TNRef RefId="1" />
                  <LST />
                </Obj>
              </En>
            </DCT>
          </Obj>
          <Nil N="PowerShellGetFormatVersion" />
          <Nil N="ReleaseNotes" />
          <Obj N="Dependencies" RefId="9">
            <TNRef RefId="1" />
            <LST />
          </Obj>
          <S N="RepositorySourceLocation">https://www.powershellgallery.com/api/v2/</S>
          <S N="Repository">PSGallery</S>
          <S N="PackageManagementProvider">NuGet</S>
          <Obj N="AdditionalMetadata" RefId="10">
            <TN RefId="3">
              <T>System.Management.Automation.PSCustomObject</T>
              <T>System.Object</T>
            </TN>
            <MS>
              <S N="copyright">Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.</S>
              <S N="description">The AWS Lambda Tools for Powershell can be used to create and deploy AWS Lambda functions written in PowerShell.</S>
              <S N="requireLicenseAcceptance">False</S>
              <S N="isLatestVersion">True</S>
              <S N="isAbsoluteLatestVersion">True</S>
              <S N="versionDownloadCount">3</S>
              <S N="downloadCount">3649</S>
              <S N="packageSize">110778</S>
              <S N="published">2/7/2019 7:26:20 PM +00:00</S>
              <S N="created">2/7/2019 7:26:20 PM +00:00</S>
              <S N="lastUpdated">2/7/2019 11:30:49 PM +00:00</S>
              <S N="tags">AWS Lambda PSModule PSEdition_Core PSFunction_Get-AWSPowerShellLambdaTemplate PSCommand_Get-AWSPowerShellLambdaTemplate PSFunction_New-AWSPowerShellLambda PSCommand_New-AWSPowerShellLambda PSFunction_New-AWSPowerShellLambdaPackage PSCommand_New-AWSPowerShellLambdaPackage PSFunction_Publish-AWSPowerShellLambda PSCommand_Publish-AWSPowerShellLambda PSIncludes_Function</S>
              <S N="developmentDependency">False</S>
              <S N="updated">2019-02-07T23:30:49Z</S>
              <S N="NormalizedVersion">1.2.0</S>
              <S N="Authors">Amazon.com Inc</S>
              <S N="IsPrerelease">false</S>
              <S N="ItemType">Module</S>
              <S N="FileList">AWSLambdaPSCore.nuspec|AWSLambdaPSCore.psd1|AWSLambdaPSCore.psm1|Private\_ArgumentCompleters.ps1|Private\_BlueprintFunctions.ps1|Private\_Constants.ps1|Private\_DeploymentFunctions.ps1|Private\_ProjectCreationFunctions.ps1|Public\Get-AWSPowerShellLambdaTemplate.ps1|Public\New-AWSPowerShellLambda.ps1|Public\New-AWSPowerShellLambdaPackage.ps1|Public\Publish-AWSPowerShellLambda.ps1|Templates\Blueprints\aws-lambda-tools-defaults.txt|Templates\Blueprints\bootstrap.cs.txt|Templates\Blueprints\projectfile.csproj.txt|Templates\Blueprints\ps-lambda-blueprint-manifest.json|Templates\Blueprints\Basic\basic.ps1.txt|Templates\Blueprints\Basic\readme.txt|Templates\Blueprints\CloudFormationCustomResource\cloudformationcustomresource.ps1.txt|Templates\Blueprints\CloudFormationCustomResource\readme.txt|Templates\Blueprints\CodeCommitTrigger\codecommittrigger.ps1.txt|Templates\Blueprints\CodeCommitTrigger\readme.txt|Templates\Blueprints\DetectLabels\detectlabels.ps1.txt|Templates\Blueprints\DetectLabels\readme.txt|Templates\Blueprints\KinesisStreamProcessor\kinesisstreamprocessor.ps1.txt|Templates\Blueprints\KinesisStreamProcessor\readme.txt|Templates\Blueprints\S3Event\readme.txt|Templates\Blueprints\S3Event\s3event.ps1.txt|Templates\Blueprints\S3EventToSNS\readme.txt|Templates\Blueprints\S3EventToSNS\s3tosns.ps1.txt|Templates\Blueprints\S3EventToSNSToSQS\readme.txt|Templates\Blueprints\S3EventToSNSToSQS\s3tosnstosqs.ps1.txt|Templates\Blueprints\S3EventToSQS\readme.txt|Templates\Blueprints\S3EventToSQS\s3tosqs.ps1.txt|Templates\Blueprints\SNSSubscription\readme.txt|Templates\Blueprints\SNSSubscription\snssubscription.ps1.txt|Templates\Blueprints\SNSToSQS\readme.txt|Templates\Blueprints\SNSToSQS\snstosqs.ps1.txt|Templates\Blueprints\SQSQueueProcessor\readme.txt|Templates\Blueprints\SQSQueueProcessor\sqsprocessor.ps1.txt</S>
              <S N="GUID">79b7bff6-b031-4d8d-b17c-e7e11f1a741f</S>
              <S N="PowerShellVersion">6.0</S>
              <S N="CompanyName">Amazon.com, Inc</S>
            </MS>
          </Obj>
          <S N="InstalledLocation">C:\Users\appveyor\AppData\Local\Temp\1\f54ceda7-1010-4ab3-bc5f-d0902f93b888\AWSLambdaPSCore\1.2.0.0</S>
        </MS>
      </Obj>
    </Objs>
    
  • tools\AWSLambdaPSCore\Public\Get-AWSPowerShellLambdaTemplate.ps1 Show
    <#
        .SYNOPSIS
        Lists the available PowerShell script templates.
    
        .DESCRIPTION
        Lists the available PowerShell script templates. The templates are used with the New-AWSPowerShellLambda
        cmdlet's -Template parameter to create an initial PowerShell script or project to get started with using
        PowerShell in AWS Lambda.
    
        .PARAMETER InstalledOnly
        Overrides default behavior to obtain the list of available templates from online sources which will include
        new and updated templates released periodically. If the switch is specified only those templates that were
        installed as part of the AWSLambdaPowerShell module are returned.
    
        .EXAMPLE
        Get-AWSPowerShellLambdaTemplate
    
        Outputs the latest available template content from online and outputs the template details to the pipeline.
        If the online content cannot be reached the cmdlet will fall back to outputting the details of templates
        installed with the module.
    
        .EXAMPLE
        Get-AWSPowerShellLambdaTemplate -InstalledOnly
    
        Outputs the details of the available templates from those installed with this module to the pipeline.
    #>
    function Get-AWSPowerShellLambdaTemplate
    {
    
        [CmdletBinding()]
    
        $manifest = _loadBlueprintManifest
        foreach ($b in $manifest.blueprints) {
            [PSCustomObject]@{
                Template = $b.name
                Description = $b.description
            }
        }
    }
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBssssDWxnX735N
    # aEUYGIKE/6OcnmoyzlxrbzlXCMDcuqCCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8BZTqudeakC1x5J
    # sTtNh/7CeKu/71KunK8I2TnlmlE+aV8wEE5xY2xY4fAgMxsPdL5byxLh24zEgJRy
    # u/ZFmp7BJQv7oxye2KYJcHHswEdMj33D3hnOPu4Eco4X0//wsgUyGUzTsByf/qV4
    # IEJwQbAmjG8AyDoAEUF6QbCnipEEoJl49He082Aq5mxQBLcUYP8NUfSoi4T+Idpc
    # Xn31KXlPsER0b21y/wIDAQAB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SaF83lr4oAZv9S
    # gADcCJ5wQZ4IGfISE4ZvF1RHsSn03yiOM6lJtzltp2dCu0UG3DYeCTpGRYLAkjKG
    # haRLN3lusS9u4ZmPDXlBMBbcdTsxRjan9VP6CT+LC99Qp2OTkTwEnnt3wC7DQnqF
    # i6GCAg8wggILBgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVT
    # MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
    # b20xITAfBgNVBAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr
    # 1tXq5hfwZjAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAc
    # BgkqhkiG9w0BCQUxDxcNMTkwMjA3MTg1MzA5WjAjBgkqhkiG9w0BCQQxFgQUXMb9
    # og/+ip+DluxN5ctd4SNy4ZUwDQYJKoZIhvcNAQEBBQAEggEAjb9KC+88TFq3VhXM
    # tdVDqOeCwYBC15GPArpp8pyfnwQJNrFmN6oL0Qkk8bjSS6XWy6J0YIXT1fDyxzBO
    # NBquhIzQpxJX9oAPizUoMeet3WyQPrbjoEpLUJHqEeJ5PmC4FCC6ieTakgTO0pMF
    # 8hv6xWwVg6+uFp9pKmUYAkxD7sbU49+JUik6mtO+KFk9hp5P0o5dvd7gDqfUNqce
    # zZruLvHKKT0kaIto6rGiknh2N2NrCUdD5vEl+dI6E+cnF4+GjkciyMd6Mz4QZVp0
    # KxFpRrGGjiT3KINuzu5GrTB9yoC6NfyAeoTIGABgYa2KxRMMDI++XTM1qUqghTFH
    # OgHWyg==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\Public\New-AWSPowerShellLambda.ps1 Show
    <#
        .SYNOPSIS
        Create a new PowerShell script file.
    
        .DESCRIPTION
        Creates a new AWS Lambda function in a PowerShell script file, or a project containing a script file,
        based on a template or 'blueprint'. The script or project can later be published to AWS Lambda
        using the Publish-AWSPowerShellLambda cmdlet or compiled into a deployment package bundle using the 
        New-AWSPowerShellLambdaPackage function for publishing at a later date using services such as AWS CloudFormation.
    
        Using the project based workflow is for advanced use cases when you need more control over how the script is loaded
        or need to include additional files. If you just need to deploy a single script consider using the simpler script
        based workflow.
    
        A project will consist of the following files, some file names are based on the Name parameter.
            * <name>.ps1 - The main file to be edited. This is the PowerShell script that will be invoked for each Lambda function invocation.
            * <name>.csproj> - The .NET project file used to build the Lambda package bundle
            * Bootstrap.cs - C# Code that indicates the PowerShell script to execute during a Lambda function invocation
            * aws-lambda-tools-defaults.json - Contains default values used when publishing the project. If you rename files be sure update the function-handler field in this property to match the changes.
    
        .PARAMETER Directory
        The name of folder to contain the script file and other content from the template. If not specified
        a subfolder matching the template name will be created in the current working folder and the content
        from the template will be saved into that subfolder.
    
        .PARAMETER ProfileName
        Optional parameter to preconfigure the AWS credentials profile the project will be published with. This can be overriden when publishing.
    
        .PARAMETER ProjectName
        The name of the new project containing your PowerShell Lambda script. If not specified the name of the template is used. This
        value will also be used to set the output directory when -WithProject is specified if the -Directory parameter is not specified.
    
        .PARAMETER Region
        Optional parameter to preconfigure the AWS region the project will be published to. This can be overriden when publishing.
        template will be used.
    
        .PARAMETER ScriptName
        Optional basename for the generated script file containing your Lambda function. If not specified
        the original name of the script file in the selected template, which usually matches the template name, is used.
    
        .PARAMETER Template
        The name of the template to use for creating the PowerShell script. To see a list of available templates
        use the Get-AWSPowerShellLambdaTemplate cmdlet.
    
        .PARAMETER WithProject
        Optional switch that will create an AWS Lambda project for the PowerShell script. This is an advanced use case providing the
        ability to customize the files added to the Lambda deployment bundle and the PowerShell Host executing in the Lambda function.
    
    
        .EXAMPLE
        New-AWSPowerShellLambda -Template S3Event
    
        Creates a new script function from the template named 'S3Event' into the subfolder
        named 'S3Event' in the current working location.
    
        .EXAMPLE
        New-AWSPowerShellLambda -Template S3Event -Directory .\s3EventProcessor
    
        Creates a new script function from the template named 'S3Event' into the subfolder
        named 's3EventProcessor' in the current working location.
    
        .EXAMPLE
        New-AWSPowerShellLambda -Template S3Event -Directory C:\MyLambdaFunctions
    
        Creates a new script function from the template named 'S3Event' into the
        C:\MyLambdaFunctions folder.
    
        .EXAMPLE
        New-AWSPowerShellLambda -Template S3Event -ScriptName MyS3EventFunction
    
        Creates a new script function from the template named 'S3Event' in the current working location.
        The script file containing your new Lambda function will have the filename MyS3EventFunction.ps1.
    
        .EXAMPLE
        New-AWSPowerShellLambda -Template S3Event -ScriptName S3EventProcessor -WithProject -Region us-east-1
    
        In this example a new AWS Lambda PowerShell project is created in a directory called S3EventProcessor.
        The project will be preconfigured in the generated aws-lambda-tools-defaults.json file to deploy to the
        us-east-1 region.
    
        .EXAMPLE
        New-AWSPowerShellLambda -Template S3Event -ScriptName S3EventProcessor -Directory ./MyCode -WithProject
    
        In this example a new AWS Lambda PowerShell project is created in a directory called MyCode with the script
        and project files called S3EventProcessor.
    #>
    function New-AWSPowerShellLambda
    {
        param
        (
            [Parameter(Mandatory = $true,
                ValueFromPipeline = $true,
                ValueFromPipelineByPropertyName = $true,
                HelpMessage = 'The template to base the initial function script on.'
            )]
            [ValidateNotNullOrEmpty()]
            [string]$Template,
    
            [Parameter()]
            [string]$Directory,
    
            [Parameter()]
            [string]$ScriptName,
    
            [Parameter(ParameterSetName = 'Project')]
            [switch]$WithProject,
    
            [Parameter(ParameterSetName = 'Project')]
            [string]$ProjectName,
    
            [Parameter(ParameterSetName = 'Project')]
            [string]$ProfileName,
    
            [Parameter(ParameterSetName = 'Project')]
            [string]$Region
        )
    
        if ($WithProject)
        {
            if ($ProjectName)
            {
                $_projectName = $ProjectName
            }
            else
            {
                $_projectName = $Template
            }
        }
    
        if ($Directory)
        {
            $_directory = $Directory
        }
        else
        {
            if ($_projectName)
            {
                $_directory = $_projectName;
            }
            elseif ($ScriptName) 
            {
                $_directory = $ScriptName
            }
            else
            {
                $_directory = Join-Path -Path (Get-Location).Path -ChildPath $Template
            }
        }
    
        if (!(Test-Path -Path $_directory))
        {
            New-Item -ItemType Directory -Path $_directory -Force | Out-Null
        }
    
        $splat = @{
            Template = $Template
            Directory = $_directory
            BaseName = $ScriptName
        }
        $_functionScriptFile = _initializeScriptFromTemplate @splat
        if ($WithProject)
        {
            $splat = @{
                ProjectName = $_projectName
                ScriptFile = $_functionScriptFile
                Directory = $_directory
                QuietMode = $false
                ProfileName = $ProfileName
                Region = $Region
            }
            _addPowerShellLambdaProjectContent @splat
            Write-Host ('New AWS lambda PowerShell project {0} from template {1} at {2}' -f $_projectName, $Template, (Resolve-Path -Path $_directory))
        }
        else
        {
            Write-Host ('Created new AWS Lambda PowerShell script {0} from template {1} at {2}' -f $_functionScriptFile, $Template, (Resolve-Path $_directory))
        }
    }
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBakjJ5bs3qDngs
    # 84AjmjmSSay69ChuT8mLms8Oh1D/vKCCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8BZTqudeakC1x5J
    # sTtNh/7CeKu/71KunK8I2TnlmlE+aV8wEE5xY2xY4fAgMxsPdL5byxLh24zEgJRy
    # u/ZFmp7BJQv7oxye2KYJcHHswEdMj33D3hnOPu4Eco4X0//wsgUyGU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isLiJOB/17AGa+VngFZ0xLJXuXJhhO2rb9XIlW9ozvgp6V74
    # ofzXVu6iHldqfehrUTZdrBm8GFDGDXUdV0hjt/jedWHQU/N6m5/MJE2Y9IpcVSsG
    # psBuMnpfaqOs/OrryJSsQqQeJUPB10ZhorSCAh8dVcA1wSlSS/bj0uZr9ETb9TYA
    # VnHEfkCZ/W0tGiwYyQTjzkXypBFLRVYwzMM8nVXM9M4OY8AxKuDCCk/cH4p9x7KW
    # 7aGCAg8wggILBgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVT
    # MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
    # b20xITAfBgNVBAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr
    # 1tXq5hfwZjAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAc
    # BgkqhkiG9w0BCQUxDxcNMTkwMjA3MTg1MzA5WjAjBgkqhkiG9w0BCQQxFgQUJ8vc
    # kk+pDMQXVULB26FBhDAMkO4wDQYJKoZIhvcNAQEBBQAEggEATvMRRP95A4Z4VNxv
    # LyRBfitZrUzjc/htYZtcNwTZJyeKFQWxSvYrUKBbBCI2qhnSPSdcfIPChJjf0pBw
    # AC7ad0f26Xaui8N4os1tBWQGnyiy3QhiJUSy+gHeGotfaywZiBilRPsKOesXZYQz
    # 6iM/qR2HsRPWbCHJfANraJTzKdZPAurz4E5TgfCOjYcB0WmOroN4HudF/jsHzCHN
    # LfiwYQLm+SN/wId2dTtckmKBmj8OiQQn3mJ3Lr3ICJvwYgwM9BtLtJ/nx9dQGfOf
    # xpVQ/O1Gt1s0daQsgKl5DupdCHuFXya6slX9m7g3jQ9dwDqeJ9sCBTsYnu7pnwoD
    # gLw2MQ==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\Public\New-AWSPowerShellLambdaPackage.ps1 Show
    <#
        .SYNOPSIS
        Creates a deployment package bundle for a PowerShell script or script project that can be published separately to an
        AWS Lambda Function.
    
        .DESCRIPTION
        PowerShell scripts and script projects are deployed to AWS Lambda as a .NET Core package bundle.
    
        For standalone script files this cmdlet will create a package bundle using a temporary .NET Core C# project that
        will include the specified PowerShell script and any required PowerShell modules. The temporary C# project also
        includes code to bootstrap the PowerShell runtime and execute the Lambda function.
    
        For script projects the bundle will be created using your existing project content. Using the project based workflow
        is for advanced use cases when you need more control over how the script is loaded or need to include additional
        files. If you just need to deploy a single script consider using the simpler script based workflow.
    
        For both standalone scripts and script projects the package bundle (a zip file) can then be deployed separately
        to AWS Lambda.
    
        .PARAMETER DisableModuleRestore
        Skip restoring any required PowerShell modules when deploying a project.
    
        .PARAMETER ProjectDirectory
        The directory containing the AWS Lambda PowerShell project to publish.
    
        .PARAMETER ModuleRepository
        Custom repositories to use when downloading modules to satisfy your script's declared dependencies.
    
        .PARAMETER OutputPackage
        Set this parameter to zip file to generate just the deployment package that will be deployed as part of another system.
    
        .PARAMETER PowerShellSdkVersion
        Optional parameter to override the version of PowerShell that will execute the script. The version number 
        must match a version of the Microsoft.PowerShell.SDK NuGet package. https://www.nuget.org/packages/Microsoft.PowerShell.SDK
    
        .PARAMETER ScriptPath
        The path to the PowerShell script file to be published to AWS Lambda.
    
        .PARAMETER StagingDirectory
        Optional parameter to set the directory where the AWS Lambda package bundle for a standalone script deployment
        will be created. If not set the system temp directory will be used.
    
        .EXAMPLE
        New-AWSPowerShellLambdaPackage -ScriptPath cleanup-s3-bucket.ps1 -OutputPackage C:\PendingDeployment\MyS3CleanupFunction.zip
    
        Creates the zip file C:\PendingDeployment\MyS3CleanupFunction.zip containing the packaged function from the script file
        .\cleanup-s3-bucket.ps1 that can be deployed separately to AWS Lambda.
    
        .EXAMPLE
        New-AWSPowerShellLambdaPackage -OutputPackage C:\PendingDeployment\MyS3CleanupProjectBundle.zip
    
        Creates a zip file containing the deployment bundle for a script project in the current directory.
    
        .EXAMPLE
        New-AWSPowerShellLambdaPackage -ProjectDirectory C:\MyLambdaProject -OutputPackage C:\PendingDeployment\MyS3CleanupProjectBundle.zip
    
        Creates a zip file containing the deployment bundle for the script project in the folder C:\MyLambdaProject.
    #>
    function New-AWSPowerShellLambdaPackage
    {
        [CmdletBinding(DefaultParameterSetName = 'PackageScript')]
        param
        (
            [Parameter(Mandatory = $true,
                ParameterSetName = 'PackageScript',
                HelpMessage = 'The path to the PowerShell script to be packaged for later deployment to AWS Lambda.')]
            [string]$ScriptPath,
    
            [Parameter(ParameterSetName = 'PackageScript')]
            [string]$StagingDirectory,
    
            [Parameter(ParameterSetName = 'PackageScript')]
            [string]$PowerShellSdkVersion,
    
            [Parameter(ParameterSetName = 'PackageProject')]
            [string]$ProjectDirectory,
    
            [Parameter(ParameterSetName = 'PackageProject')]
            [switch]$DisableModuleRestore,
    
            [Parameter(Mandatory = $true,
                HelpMessage = 'The path and name of the output package bundle (zip file) to create.')]
            [String]$OutputPackage,
    
            [Parameter()]
            [string[]]$ModuleRepository
        )
    
        _validateDotnetInstall
    
        # If staging directory is a new temp directory then delete the stage directory after publishing completes
        $deleteStagingDirectory = $false
    
        if ($PSCmdlet.ParameterSetName -eq 'PackageScript')
        {
            if (!(Test-Path -Path $ScriptPath))
            {
                throw "Script $ScriptPath does not exist."
            }
    
            if(!($StagingDirectory))
            {
                $deleteStagingDirectory = $true
            }
                    
            # Creates and returns an updated StagingDirectory with the ScriptName inside it
            $_name = [System.IO.Path]::GetFileNameWithoutExtension($ScriptPath)
            $stagingSplat = @{
                Name             = $_name
                StagingDirectory = $StagingDirectory
            }
            $StagingDirectory = _createStagingDirectory @stagingSplat
    
            $_scriptPath = (Resolve-Path -Path $ScriptPath).Path
            $_buildDirectory = (Resolve-Path -Path $StagingDirectory).Path
    
            $splat = @{
                ProjectName = $_name
                ScriptFile  = [System.IO.Path]::GetFileName($_scriptPath)
                Directory   = $_buildDirectory
                QuietMode   = $false
                PowerShellSdkVersion = $PowerShellSdkVersion
            }
            _addPowerShellLambdaProjectContent @splat
    
            Write-Host 'Copying PowerShell script to staging directory'
            Copy-Item -Path $_scriptPath -Destination $_buildDirectory
    
            $splat = @{
                Script           = $_scriptPath
                ProjectDirectory = $_buildDirectory
                ClearExisting    = $true
                ModuleRepository = $ModuleRepository
            }
            _prepareDependentPowerShellModules @splat
    
            $namespaceName = _makeSafeNamespaceName $_name
            $_handler = "$_name::$namespaceName.Bootstrap::ExecuteFunction"
        }
        else
        {
            if (!($ProjectDirectory))
            {
                $ProjectDirectory = $pwd.Path
            }
    
            if (!(Test-Path -Path $ProjectDirectory))
            {
                throw "Project directory $ProjectDirectory does not exist."
            }
    
            if (!($DisableModuleRestore))
            {
                $clearExisting = $true
    
                $targetPath = Join-Path -Path $ProjectDirectory -ChildPath '*.ps1'
                Get-ChildItem -Path $targetPath | ForEach-Object {
                    $splat = @{
                        Script           = $_.FullName
                        ProjectDirectory = $ProjectDirectory
                        ClearExisting    = $clearExisting
                        ModuleRepository = $ModuleRepository
                    }
                    _prepareDependentPowerShellModules @splat
    
                    $clearExisting = $false
                }
            }
    
            $_buildDirectory = $ProjectDirectory
            $_handler = $Handler
        }
    
        if (!([System.IO.Path]::IsPathRooted($OutputPackage)))
        {
            $OutputPackage = Join-Path -Path $pwd -ChildPath $OutputPackage
            Write-Host "Resolved full output package path as $OutputPackage"
        }
    
        Write-Host "Creating deployment package at $OutputPackage"
    
        _packageProject -OutputPackage $OutputPackage -BuildDirectory $_buildDirectory
    
        if ($PSCmdlet.ParameterSetName -eq 'PackageScript')
        {
            Write-Host "When deploying this package to AWS Lambda you will need to specify the function handler. The handler for this package is: $_handler. To request Lambda to invoke a specific PowerShell function in your script specify the name of the PowerShell function in the environment variable $AwsPowerShellFunctionEnvName when publishing the package."
    
            # Resolve-Path added to fix relative paths and improve PathToPackage output
            [PSCustomObject][ordered]@{
                LambdaHandler                   = $_handler
                PathToPackage                   = Resolve-Path -Path $OutputPackage
                PowerShellFunctionHandlerEnvVar = 'AWS_POWERSHELL_FUNCTION_HANDLER'
            }
    
            if($deleteStagingDirectory)
            {
                Write-Verbose -Message "Removing staging directory $_buildDirectory"
                Remove-Item -Path $_buildDirectory -Recurse -Force       
            }        
        }
    }
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDePbhf7Kt9G7WD
    # byKfTW+deFZwy2aDfHtEWczrXV+pZaCCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8BZTqudeakC1x5J
    # sTtNh/7CeKu/71KunK8I2TnlmlE+aV8wEE5xY2xY4fAgMxsPdL5byxLh24zEgJRy
    # u/ZFmp7BJQv7oxye2KYJcHHswEdMj33D3hnOPu4Eco4X0//wsgUyGUzTsByf/qV4
    # IEJwQbAmjG8AyDoAEUF6QbCnipEEoJl49He082Aq5mxQBLcUYP8NUfSoi4T+Idpc
    # Xn31KXlPsER0b21y/wIDAQABo4IBeDCCAXQwLgYIKwYBBQUHAQEEIjAgMB4GCCsG
    # AQUFBzABhhJodHRwOi8vcy5zeW1jZC5jb20wEgYDVR0TAQH/BAgwBgEB/wIBADBm
    # BgNVHSAEXzBdMFsGC2CGSAGG+EUBBxcDMEwwIwYIKwYBBQUHAgEWF2h0dHBzOi8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AGkAbgBjAG8AcgBwAG8AcgBhAHQAZQBkACAA
    # aABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBlAHIAZQBuAGMAZQAuMAsGCWCGSAGG
    # /WwDFTAfBgNVHSMEGDAWgBQVABIrE5iymQftHt+ivlcNK2cCzTAdBgNVHQ4EFgQU
    # YVpNJLZJMp1KKnkag0v0HonByn0wfQYDVR0fBHYwdDA4oDagNIYyaHR0cDovL2Ny
    # bDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0QXNzdXJlZElEQ0EtMS5jcmwwOKA2oDSG
    # Mmh0dHA6Ly9jcmw0LmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEFzc3VyZWRJRENBLTEu
    # Y3JsMHcGCCsGAQUFBwEBBGswaTAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGln
    # aWNlcnQuY29tMEEGCCsGAQUFBzAChjVodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5j
    # b20vRGlnaUNlcnRBc3N1cmVkSURDQS0xLmNydDANBgkqhkiG9w0BAQUFAAOCAQEA
    # nSV+GzNNsiaBXJuGziMgD4CH5Yj//7HUaiwx7ToXGXEXzakbvFoWOQCd42yE5FpA
    # +94GAYw3+puxnSR+/iCkV61bt5qwYCbqaVchXTQvH3Gwg5QZBWs1kBCge5fH9j/n
    # 4hFBpr1i2fAnPTgdKG86Ugnw7HBi02JLsOBzppLA044x2C/jbRcTBu7kA7YUq/OP
    # Q6dxnSHdFMoVXZJB2vkPgdGZdA0mxA5/G7X1oPHGdwYoFenYk+VVFvC7Cqsc21xI
    # J2bIo4sKHOWV2q7ELlmgYd3a822iYemKC23sEhi991VUQAOSK2vCUcIKSK+w1G7g
    # 9BQKOhvjjz3Kr2qNe9zYRDCCBs0wggW1oAMCAQICEAb9+QOWA63qAArrPye7uhsw
    # DQYJKoZIhvcNAQEFBQAwZTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0
    # IEluYzEZMBcGA1UECxM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FiqKgz5Js5p8T1zh14dpQl
    # c+Qqq8+cdkvtX8JLFuRLcEwAiR78xXm8TBJX/l/hHrwCXaj++wc4Tw3GXZG5D2dF
    # zdaD7eeSDY2xaYxP+1ngIw/Sqq4AfO6cQg7PkdcntxbuD8O9fAqg7iwIVYUiuOsY
    # Gk38KiGtSTGDR5V3cdyxG0tLHBCcdxTBnU8vWpUIKRAmMYIEXzCCBFsCAQEwgZkw
    # gYQxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEf
    # MB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazE1MDMGA1UEAxMsU3ltYW50
    # ZWMgQ2xhc3MgMyBTSEEyNTYgQ29kZSBTaWduaW5nIENBIC0gRzICECt3g4UAT0ym
    # kcB/NZDAe38wDQYJYIZIAWUDBAIBBQCggYQwGAYKKwYBBAGCNwIBDDEKMAigAoAA
    # oQKAADAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgorBgEEAYI3AgELMQ4w
    # DAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgBR4S7pLDT1CkPaYkOri6D3nR
    # r4MF4WAQzY+JT/p/iaMwDQYJKoZIhvcNAQEBBQAEggEANs+jN9+J4yam1AGoKlGL
    # RNRham9JJZUvT6pFGe5wRx6khENuT8Cjiw5Cw2f94FIvG5U+KKg/aGfo1X0d9sYI
    # fAw5lvz3gSEpSKLfvrhuBSAN5izb9tA1/QxoULJCtFVfGviJKxPI8msb12CFBLc7
    # qTYF/ta5MkuHDaeKGuWEoo65xohtYkONRdx44fWuRdpCY7dJOHBnfl1s2IO96+4F
    # LbCF24vSnnxfezFMyqKsfxXuW8EPxCGdJvu990n/js6aJuqSrfjpJC6SnP4PX76Y
    # xMBoHPBxew0OHfiDTn35IVtBdMgHRDmFcwRiO1wmUnuNkzce5hWE5AgPAYaJc1R/
    # O6GCAg8wggILBgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVT
    # MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
    # b20xITAfBgNVBAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr
    # 1tXq5hfwZjAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAc
    # BgkqhkiG9w0BCQUxDxcNMTkwMjA3MTg1MzA5WjAjBgkqhkiG9w0BCQQxFgQUd680
    # zLe6WhriXpHAvJEjF/D2GY0wDQYJKoZIhvcNAQEBBQAEggEAgtElRXAWfUSA2iPx
    # WYJfltKTjwx+U026wGg+NHF5rDztC/BtBQayQceJwDeloNW8VUHiQUt6w+PMgud5
    # 2Lyq0lCbFcWiRXGpPXbkncWSgeE/T38ZH6WTLhsS2NYzdYmjsH2uptcsmttyBygR
    # zcD93Kozi+xaIycD+NpKjgeBrSb7Z2U5FjA+HhpdcRZ4SAK8jHXNy9AwUC+MU5Ps
    # vD4khNjonwbGt+XVcC0K8W2bcq93F5z/M17MJBqKWOiU+ezmiG4iQDaWgOEKobUo
    # qmMYa5/7OWxjHQ8unbSPsrSyGM8ZXRrFLhkogQbb0df3k6r8MSKtkWVrrDeTCo+k
    # mCctoQ==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\Public\Publish-AWSPowerShellLambda.ps1 Show
    <#
        .SYNOPSIS
        Publishes (deploys) a PowerShell script or script project as an AWS Lambda Function.
    
        .DESCRIPTION
        PowerShell scripts are deployed to AWS Lambda as a .NET Core package bundle. For standalone script files this cmdlet will
        create a temporary .NET Core C# project that will include the specified PowerShell script and any required PowerShell modules.
        The C# project also includes code to bootstrap the PowerShell runtime and execute the Lambda function.
    
        The cmdlet can also be used to publish a script project to AWS Lambda. Using the project based workflow is for advanced use
        cases when you need more control over how the script is loaded or need to include additional files. If you just need to deploy
        a single script consider using the simpler script based workflow.
    
        When publishing a project-based script function many of the configuration parameters can be specified in a configuration file
        in your project named aws-lambda-tools-defaults.json. If your script project was generated using the New-AWSPowerShellLambda
        cmdlet a default version of this file will have been created for you. The following cmdlet parameters can take their values
        from the aws-lambda-tools-defaults.json file:
    
        * DeadLetterQueueArn
        * EnvironmentVariable
        * Handler
        * Memory
        * Name
        * IAMRoleArn
        * SecurityGroup
        * Subnet
        * Timeout
        * KmsKeyArn
        * Profile
        * Region
        * Tag
        * TracingMode
    
        .PARAMETER DeadLetterQueue
        Optional, target ARN of an SNS topic or SQS Queue for the Dead Letter Queue.
    
        .PARAMETER DisableInteractive
        Do not prompt for missing function configuration values required for successful deployment to AWS Lambda.
    
        .PARAMETER DisableModuleRestore
        Skip restoring any required PowerShell modules when deploying a project.
    
        .PARAMETER EnvironmentVariable
        Collection of key=value environment variables to be set for the function when it executes inside AWS Lambda.
    
        .PARAMETER Handler
        The string that identifies the entry point in the Lambda package bundle.
    
        .PARAMETER KmsKeyArn
        KMS Key ARN of a customer key used to encrypt the function's environment variables.
    
        .PARAMETER Memory
        The amount of memory, in MB, your Lambda function is given when it executes inside AWS Lambda.
    
        .PARAMETER ModuleRepository
        Custom repositories to use when downloading modules to satisfy your script's declared dependencies.
    
        .PARAMETER Name
        The name of the AWS Lambda function that will execute the PowerShell script.
    
        .PARAMETER PowerShellFunctionHandler
        The name of the specific PowerShell function to be invoked when your Lambda function executes. The default
        behavior is to use the script in its entirety as the function handler. The name of the function to run, if
        specified, is communicated to Lambda using an environment variable named AWS_POWERSHELL_FUNCTION_HANDLER.
    
        .PARAMETER PowerShellSdkVersion
        Optional parameter to override the version of PowerShell that will execute the script. The version number
        must match a version of the Microsoft.PowerShell.SDK NuGet package. https://www.nuget.org/packages/Microsoft.PowerShell.SDK
    
        .PARAMETER ProfileName
        The AWS credentials profile to use when publishing to AWS Lambda. If not set environment credentials will be used.
    
        .PARAMETER ProjectDirectory
        The directory containing the AWS Lambda PowerShell project to publish.
    
        .PARAMETER PublishNewVersion
        Publish a new version as an atomic operation.
    
        .PARAMETER Region
        The region to connect to AWS services, if not set region will be detected from the environment.
    
        .PARAMETER IAMRoleArn
        The IAM role ARN that Lambda assumes when it executes your function.
    
        .PARAMETER S3Bucket
        S3 bucket to upload the build output.
    
        .PARAMETER S3KeyPrefix
        S3 key prefix for the build output.
    
        .PARAMETER StagingDirectory
        Optional parameter to set the directory where the AWS Lambda package bundle for a standalone script deployment
        will be created. If not set the system temp directory will be used.
    
        .PARAMETER ScriptPath
        The path to the PowerShell script file to be published to AWS Lambda.
    
        .PARAMETER SecurityGroup
        List of security group ids if your function references resources in a VPC.
    
        .PARAMETER Subnet
        List of subnet ids if your function references resources in a VPC.
    
        .PARAMETER Timeout
        The function execution timeout in seconds.
    
        .PARAMETER Tag
        Tags applied to the function.
    
        .PARAMETER TracingMode
        Configures when AWS X-Ray should trace the function. Valid values: PassThrough or Active.
    
        .EXAMPLE
        Publish-AWSPowerShellLambda -Name S3CleanupFunction -ScriptPath cleanup-s3-bucket.ps1
    
        This example creates a package bundle with the script and any required PowerShell modules and deploys the bundle to AWS Lambda.
        AWS Credentials and region will be determined by the environment running the cmdlet.
    
        .EXAMPLE
        Publish-AWSPowerShellLambda -Name S3CleanupFunction -ScriptPath cleanup-s3-bucket.ps1 -Profile beta -Region us-west-2
    
        In this example the profile to find AWS credentials and the AWS region are set explicitly.
    
        .EXAMPLE
        Publish-AWSPowerShellLambda -Name SampleLambda -ScriptPath sample-lambda.ps1 -EnvironmentVariable @{'TABLE_NAME'='MyDynamoDBTable'}
    
        This example creates a package bundle with the script and any required PowerShell modules and deploys the bundle to AWS Lambda.
        AWS Credentials and region will be determined by the environment running the cmdlet.
    
        The deployed Lambda Function will include the Environment Variable "TABLE_NAME" with the value of "MyDynamoDBTable".
    #>
    function Publish-AWSPowerShellLambda
    {
        [CmdletBinding(DefaultParameterSetName = 'DeployScript')]
        param
        (
            [Parameter(Mandatory = $true,
                ParameterSetName = 'DeployScript',
                HelpMessage = 'The name of the AWS Lambda function that will execute the PowerShell script.')]
            [Parameter(ParameterSetName = 'DeployProject')]
            [string]$Name,
    
            [Parameter(Mandatory = $true,
                ParameterSetName = 'DeployScript',
                HelpMessage = 'The path to the PowerShell script to be published to AWS Lambda.')]
            [string]$ScriptPath,
    
            [Parameter(ParameterSetName = 'DeployScript')]
            [string]$StagingDirectory,
    
            [Parameter(Mandatory = $true,
                ParameterSetName = 'DeployProject',
                HelpMessage = 'The path to the PowerShell project to be published to AWS Lambda.')]
            [string]$ProjectDirectory,
    
            [Parameter(ParameterSetName = 'DeployProject')]
            [string]$Handler,
    
            [Parameter(ParameterSetName = 'DeployProject')]
            [switch]$DisableModuleRestore,
    
            [Parameter()]
            [string]$PowerShellFunctionHandler,
    
            [Parameter()]
            [string]$ProfileName,
    
            [Parameter()]
            [string]$Region,
    
            [Parameter()]
            [string]$IAMRoleArn,
    
            [Parameter()]
            [int]$Memory,
    
            [Parameter()]
            [int]$Timeout,
    
            [Parameter()]
            [Switch]$PublishNewVersion,
    
            [Parameter()]
            [Hashtable]$EnvironmentVariable,
    
            [Parameter()]
            [string]$KmsKeyArn,
    
            [Parameter()]
            [string[]]$Subnet,
    
            [Parameter()]
            [string[]]$SecurityGroup,
    
            [Parameter()]
            [string]$DeadLetterQueueArn,
    
            [Parameter()]
            [ValidateSet('Active', 'PassThrough')]
            [string]$TracingMode,
    
            [Parameter()]
            [string]$S3Bucket,
    
            [Parameter()]
            [string]$S3KeyPrefix,
    
            [Parameter()]
            [Hashtable]$Tag,
    
            [Parameter()]
            [string[]]$ModuleRepository,
    
            [Parameter(ParameterSetName = 'DeployScript')]
            [string]$PowerShellSdkVersion,
    
            [Parameter()]
            [Switch]$DisableInteractive
        )
    
        _validateDotnetInstall
    
        # If staging directory is a new temp directory then delete the stage directory after publishing completes
        $deleteStagingDirectory = $false
    
        if ($PSCmdlet.ParameterSetName -eq 'DeployScript')
        {
            if (!(Test-Path -Path $ScriptPath))
            {
                throw "Script $ScriptPath does not exist."
            }
    
            if (!($StagingDirectory))
            {
                $deleteStagingDirectory = $true
            }
    
            # Creates and returns an updated StagingDirectory with the ScriptName inside it
            $_name = [System.IO.Path]::GetFileNameWithoutExtension($ScriptPath)
            $stagingSplat = @{
                Name             = $_name
                StagingDirectory = $StagingDirectory
            }
            $StagingDirectory = _createStagingDirectory @stagingSplat
    
            $_scriptPath = (Resolve-Path -Path $ScriptPath).Path
            $_buildDirectory = (Resolve-Path -Path $StagingDirectory).Path
    
            $splat = @{
                ProjectName = $Name
                ScriptFile  = [System.IO.Path]::GetFileName($_scriptPath)
                Directory   = $_buildDirectory
                QuietMode   = $false
                PowerShellSdkVersion = $PowerShellSdkVersion
            }
            _addPowerShellLambdaProjectContent @splat
    
            Write-Host 'Copying PowerShell script to staging directory'
            Copy-Item -Path $_scriptPath -Destination $_buildDirectory
    
            $splat = @{
                Script           = $_scriptPath
                ProjectDirectory = $_buildDirectory
                ClearExisting    = $true
                ModuleRepository = $ModuleRepository
            }
            _prepareDependentPowerShellModules @splat
    
            $namespaceName = _makeSafeNamespaceName $Name
            $_handler = "$Name::$namespaceName.Bootstrap::ExecuteFunction"
        }
        else
        {
            if (!($ProjectDirectory))
            {
                $ProjectDirectory = $pwd.Path
            }
    
            if (!(Test-Path -Path $ProjectDirectory))
            {
                throw "Project directory $ProjectDirectory does not exist."
            }
    
            if (!($DisableModuleRestore))
            {
                $clearExisting = $true
                Get-ChildItem -Path $ProjectDirectory\*.ps1 | ForEach-Object {
                    $splat = @{
                        Script           = $_.FullName
                        ProjectDirectory = $ProjectDirectory
                        ClearExisting    = $clearExisting
                        ModuleRepository = $ModuleRepository
                    }
                    _prepareDependentPowerShellModules @splat
                    $clearExisting = $false
                }
            }
    
            $_buildDirectory = $ProjectDirectory
            $_handler = $Handler
        }
    
        Write-Host "Deploying to AWS Lambda"
        $splat = @{
            FunctionName           = $Name
            FunctionHandler        = $_handler
            PowerShellFunction     = $PowerShellFunctionHandler
            Profile                = $ProfileName
            Region                 = $Region
            FunctionRole           = $IAMRoleArn
            FunctionMemory         = $Memory
            FunctionTimeout        = $Timeout
            PublishNewVersion      = $PublishNewVersion
            EnvironmentVariables   = $EnvironmentVariable
            KmsKeyArn              = $KmsKeyArn
            FunctionSubnets        = $Subnet
            FunctionSecurityGroups = $SecurityGroup
            DeadLetterQueueArn     = $DeadLetterQueueArn
            TracingMode            = $TracingMode
            S3Bucket               = $S3Bucket
            S3KeyPrefix            = $S3KeyPrefix
            Tags                   = $Tag
            DisableInteractive     = $DisableInteractive
            BuildDirectory         = $_buildDirectory
        }
        _deployProject @splat
    
        if($deleteStagingDirectory)
        {
            Write-Verbose -Message "Removing staging directory $_buildDirectory"
            Remove-Item -Path $_buildDirectory -Recurse -Force
        }
    }
    # SIG # Begin signature block
    # MIIcUAYJKoZIhvcNAQcCoIIcQTCCHD0CAQExDzANBglghkgBZQMEAgEFADB5Bgor
    # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
    # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDhCD5LrfMFPkxs
    # kOxfq3sR/uyknHIQspENQpTuhEaPcaCCF0cwggS5MIIDoaADAgECAhArd4OFAE9M
    # ppHAfzWQwHt/MA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE
    # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0
    # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg
    # U2lnbmluZyBDQSAtIEcyMB4XDTE3MDcxMDAwMDAwMFoXDTIwMDcxMDIzNTk1OVow
    # ajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
    # YXR0bGUxGTAXBgNVBAoMEEFtYXpvbi5jb20sIEluYy4xGTAXBgNVBAMMEEFtYXpv
    # bi5jb20sIEluYy4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC18TJW
    # m2/aGpvb+TP2CZMg49X/5bjDAgPxWlAs7bqDyZnRYJork4rLmejpeJu+2BhRjZeK
    # OirT4XveddBsdL1/TR+FKp8BXEsrm0wcR4yT6mNHJ9yCgC1YBNG91bZ75kRIT+46
    # chbC7eNI5703wi8ejxe2KvvOERppBTaFStVJuAHab69dvFma8qE3s7wbqPdQ5eTI
    # +Xm0bXp8cObS+vj+hf3N2pfDNWM8ITva3kbowGoCW0rKzpf7fBGtBOKnOCCSL0yC
    # AOwLlFkslemVyrT1/HTDjOTKCro016HxOPddA4cefvr2ZhGlRZQQHg7wMdG7TpZX
    # ueQ6LoS9UxlzCYHFAgMBAAGjggE+MIIBOjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE
    # AwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzBhBgNVHSAEWjBYMFYGBmeBDAEEATBM
    # MCMGCCsGAQUFBwIBFhdodHRwczovL2Quc3ltY2IuY29tL2NwczAlBggrBgEFBQcC
    # AjAZDBdodHRwczovL2Quc3ltY2IuY29tL3JwYTAfBgNVHSMEGDAWgBTUwAYiSes5
    # S92T4lyhuEd2CXIDWDArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vcmIuc3ltY2Iu
    # Y29tL3JiLmNybDBXBggrBgEFBQcBAQRLMEkwHwYIKwYBBQUHMAGGE2h0dHA6Ly9y
    # Yi5zeW1jZC5jb20wJgYIKwYBBQUHMAKGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIu
    # Y3J0MA0GCSqGSIb3DQEBCwUAA4IBAQC+C4TcK44ph2QQK/1f65jOR23DtSBC3y9a
    # bzRHdo4qxmcAW5ot69os7GJfzgVsA5lh1IT4+aMuGYA4GTcF6iTSOMgFSRwP8urI
    # N2BprsWuMJsQ7+Flo3PBRN3dU6idOlFKOfuRxgIHRn47t2yRan6XTNhfiWl84DrD
    # NjSTnk4c72Gzu0hiwQB9OTsf8CQP3Shb3ZzcAOmeUB01TFoJU34PfJpKlKQZeQIi
    # W5WdPPr1G/0cAHgejDHtdNYcSqIWfoGeYgCxUg1IFpp1VmPlqb/de8QKONzPDK6/
    # 5hulSGqGgpRmEkwGGJiQeOB51GxYZRCPq3hN3UJ6N0A+hYzj7yspMIIFRzCCBC+g
    # AwIBAgIQfBs1NUrn23TnQV8RacprqDANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
    # BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
    # biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5j
    # LiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBV
    # bml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNDA3MjIw
    # MDAwMDBaFw0yNDA3MjEyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UEChMU
    # U3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0IE5l
    # dHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUgU2ln
    # bmluZyBDQSAtIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15VD
    # 1NzfZ645+1KktiYxBHDpt45bKro3aTWVj7vAMOeG2HO73+vRdj+KVo7rLUvwVxhO
    # sY2lM9MLdSPVankn3aPT9w6HZbXerRzx9TW0IlGvIqHBXUuQf8BZTqudeakC1x5J
    # sTtNh/7CeKu/71KunK8I2TnlmlE+aV8wEE5xY2xY4fAgMxsPdL5byxLh24zEgJRy
    # u/ZFmp7BJQv7oxye2KYJcHHswEdMj33D3hnOPu4Eco4X0//wsgUyGUzTsByf/qV4
    # IEJ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QB7eO2y9OvaXbsy7qOdZfKnZe9hzBrYa
    # 83oLWWJJ1wFzG7QggabfcD5JApsHZlFbbH6YEeaPkInSW12jOCcca7xM/3/+VNXF
    # u5dKPObEPztmZE8hyCLHX3VRPSffRjCamAsla5y+A+wwF2pXw1gR/Rjgb8NlLWAR
    # g1QOrSni0FXFX2nJ1GOwAvES/iuHr+wxsThBC6Ykmtw2fe6W7rcmULcUc5grzmSS
    # jaGCAg8wggILBgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVT
    # MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
    # b20xITAfBgNVBAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr
    # 1tXq5hfwZjAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAc
    # BgkqhkiG9w0BCQUxDxcNMTkwMjA3MTg1MzA5WjAjBgkqhkiG9w0BCQQxFgQUpt53
    # aP++BLKzeb1TQgWRjEmQSoAwDQYJKoZIhvcNAQEBBQAEggEAAyxCLBhFtX/EYlF7
    # fZHZ/aone2ALlvGizlcLBZjvwFq++KtF9lLB5ljJGPafj7uy0xPGcdt831BYHvND
    # qdeWR9GS8CkUOvI7grRfmxNRbf7FpJjPO7dEsyS4Dqm4A3lzJpVDXW5npbtmeelq
    # V+7pRNyElTtKr3eBwFcKDagnPbHwnY6nmjOre8Y/iAXtfWP7zV3pSngjNq4P2EBd
    # y1pRkjPi+xs2HjnKDnq/ymvkn8+rGaTb9mKKfUzYpvVOELkNvUAxJ6YONRHN6Jdz
    # ci/DrKUPafU0uG9iVTaiGvAgnQspS57KdS4d5NH3MudM3ZW82pHOeh717W3Kblmb
    # B0Q+mA==
    # SIG # End signature block
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\aws-lambda-tools-defaults.txt Show
    {
        "profile"     : "CONFIGURED_PROFILE",
        "region"      : "CONFIGURED_REGION",
        "configuration" : "Release",
        "framework"     : "netcoreapp2.1",
        "function-runtime" : "dotnetcore2.1",
        "function-memory-size" : DEFAULT_MEMORY,
        "function-timeout"     : DEFAULT_TIMEOUT,
        "function-handler"     : "PROJECT_NAME::PROJECT_NAME.Bootstrap::ExecuteFunction",
        "function-name"        : "",
        "function-role"        : "",
        "tracing-mode"         : "",
        "environment-variables" : "",
        "apply-defaults"        : true
    }
  • tools\AWSLambdaPSCore\Templates\Blueprints\Basic\basic.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function. 
    # 
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement 
    # indicating the module and version.
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.335.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
  • tools\AWSLambdaPSCore\Templates\Blueprints\Basic\readme.txt Show
    This sample creates an empty script file for implementing a Lambda function written
    in PowerShell.
    
    The script has a Requires statement for the latest version of the AWS Tools for
    PowerShell module (AWSPowerShell.NetCore) as an example for how to declare modules on
    which your function is dependent and that will be bundled with your function on
    deployment. If you do not need to use cmdlets from this module you can safely delete
    this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\bootstrap.cs.txt Show
    using Amazon.Lambda.PowerShellHost;
    
    namespace NAMESPACE_NAME
    {
        public class Bootstrap : PowerShellFunctionHost
        {
            public Bootstrap() : base("SCRIPT_FILE")
            {
            }
        }
    }
  • tools\AWSLambdaPSCore\Templates\Blueprints\CloudFormationCustomResource\cloudformationcustomresource.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.343.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    $CFNEvent = if ($null -ne $LambdaInput.Records) {
        Write-Host 'Message received via SNS - Parsing out CloudFormation event'
        $LambdaInput.Records[0].Sns.Message
    }
    else {
        Write-Host 'Event received directly from CloudFormation'
        $LambdaInput
    }
    $body = @{
        # We'll assume success and overwrite if anything fails in line to avoid code duplication
        Status             = "SUCCESS"
        Reason             = "See the details in CloudWatch Log Stream:`n[Group] $($LambdaContext.LogGroupName)`n[Stream] $($LambdaContext.LogStreamName)"
        PhysicalResourceId = $LambdaContext.LogStreamName
        StackId            = $CFNEvent.StackId
        RequestId          = $CFNEvent.RequestId
        LogicalResourceId  = $CFNEvent.LogicalResourceId
    }
    Write-Host "Processing RequestType [$($CFNEvent.RequestType)]"
    try {
        # If you want to return data back to CloudFormation, add the Data property to the body with the value as a hashtable. The hashtable keys will be the retrievable attributes when using Fn::GetAtt against the custom resource in your CloudFormation template:
        #    $body.Data = @{Secret = $null}
        switch ($CFNEvent.RequestType) {
            Create {
                # Add Create request code here
            }
            Update {
                # Add Update request code here
            }
            Delete {
                # Add Delete request code here
            }
        }
    }
    catch {
        Write-Error $_
        $body.Status = "FAILED"
    }
    finally {
        try {
            Write-Host "Sending response back to CloudFormation"
            Invoke-WebRequest -Uri $([Uri]$CFNEvent.ResponseURL) -Method Put -Body $($body | ConvertTo-Json -Depth 5)
        }
        catch {
            Write-Error $_
        }
    }
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\CloudFormationCustomResource\readme.txt Show
    This sample creates a Lambda function written in PowerShell that processes custom
    resource events from CloudFormation. It includes a Switch statement with placeholders
    for the 3 different Request Types (Create, Update and Delete) that CloudFormation
    sends. It also checks the event payload to see if CloudFormation delivered the event
    via SNS (useful in case cross-account custom resources are in place) or if
    CloudFormation sent the event directly to the Lambda. If the event is from SNS, it
    will parse out the CloudFormation event information before processing the request type.
    
    Once the event has been processed, it will send the results back to CloudFormation
    via Invoke-WebRequest using the pre-signed URL sent with the original event.
    
    The script contains a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example to not need cmdlets from that
    module you can safely delete this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\CodeCommitTrigger\codecommittrigger.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.335.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    # A CodeCommit Trigger can receive multiple records per execution
    foreach ($record in $LambdaInput.Records) {
        # Sample properties of the CodeCommit Record
        $commitId = $record.codecommit.references[0].commit
        $commitRefs = $record.codecommit.references[0].ref
        $customData = $record.customData
    
        # Perform your work here
    }
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\CodeCommitTrigger\readme.txt Show
    This sample creates a Lambda function written in PowerShell that can be subscribed
    as a Code Commit trigger.
    
    The script has a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example and it does not need cmdlets from that
    module you can safely delete this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\DetectLabels\detectlabels.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.335.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    $imageExtensions = @(".jpg",".jpeg",".png",".gif")
    
    foreach ($record in $LambdaInput.Records) {
        $bucket = $record.s3.bucket.name
        $key = $record.s3.object.key
    
        Write-Host "Processing event for: bucket = $bucket, key = $key"
    
        $ext = [System.IO.Path]::GetExtension($key)
        if ($imageExtensions.Contains($ext)) {
    
            $confidence = $env:MinConfidence
            if ($confidence) {
                Write-Host "MinConfidence environment variable set to $confidence%"
            } else {
                Write-Host "MinConfidence environment variable not set, defaulting to 70%"
                $confidence = 70
            }
    
            Write-Host "Inspecting for labels with confidence equal or higher than $confidence%"
            $labels = (Find-REKLabel -ImageBucket $bucket -ImageName $key -MinConfidence $confidence).Labels  | Select -First 10
            Write-Host 'Labels Found ' $labels.Count
    
            Write-Host "Posting up to 10 labels to the object as tags"
    
            $tags = @()
            $labels | ForEach-Object {
    
                Write-Host $_.Name '('$_.Confidence')'
    
                $tag = New-Object Amazon.S3.Model.Tag
                $tag.Key = $_.Name
                $tag.Value = $_.Confidence.ToString()
                $tags += $tag
            }
    
            Write-S3ObjectTagSet -BucketName $bucket -Key $key -Tagging_TagSet $tags
        } else {
            Write-Host "Skipped processing: object does not match a known image extension ($imageExtensions -join ',')"
        }
    }
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\DetectLabels\readme.txt Show
    This sample creates a Lambda function written in PowerShell that responds to an
    event from S3 when a new object, or object version, is created in a bucket. The
    script then uses the Amazon Rekognition service to detect objects of interest in
    the image (called 'labels') with a minimum confidence level which it then applies
    (up to maximum of 10) as tags to the S3 object. The confidence level can be customized
    by setting the environment variable MinConfidence to the required value.
    
    To work with Amazon S3 and Amazon Rekognition the script uses cmdlets from the
    AWS Tools for PowerShell module (AWSPowerShell.NetCore). To run successfully the
    function must be deployed with a role allowing access to the following service operations:
    
    rekognition:DetectLabels
    s3:PutObjectTagging
    
    The script contains a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example to not need cmdlets from that
    module you can safely delete this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\KinesisStreamProcessor\kinesisstreamprocessor.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.335.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    # A Kinesis Stream processor will receive multiple records per execution
    foreach ($record in $LambdaInput.Records) {
        # A Kinesis Stream Record is UTF8 Base64 encoded
        $bytes = [System.Convert]::FromBase64String($record.kinesis.data)
        $data = [System.Text.Encoding]::UTF8.GetString($bytes)
    
        # Perform your work to process the Kinesis Stream data record
        # Do work against $data here
    }
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\KinesisStreamProcessor\readme.txt Show
    This sample creates a Lambda function written in PowerShell that can be subscribed
    to a Kinesis Stream to process each record.
    
    The script has a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example and it does not need cmdlets from that
    module you can safely delete this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\projectfile.csproj.txt Show
    <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
            <TargetFramework>netcoreapp2.1</TargetFramework>
            <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
        </PropertyGroup>
    
        <ItemGroup>
            <Content Include="SCRIPT_FILE">
                <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
            </Content>
            <Content Include="./Modules/**">
                <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
            </Content>
        </ItemGroup>
    
        <ItemGroup>
            <PackageReference Include="Microsoft.PowerShell.SDK" Version="POWERSHELL_SDK_VERSION" />
    
            <PackageReference Include="Amazon.Lambda.Core" Version="1.0.0" />
            <PackageReference Include="Amazon.Lambda.PowerShellHost" Version="1.0.0" />
        </ItemGroup>
    </Project>
  • tools\AWSLambdaPSCore\Templates\Blueprints\ps-lambda-blueprint-manifest.json Show
    {
      "manifestVersion": 1,
      "blueprints": [
        {
          "name": "Basic",
          "description": "Bare bones script",
          "content": [
              {
                "source": "basic.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "CloudFormationCustomResource",
          "description": "PowerShell handler base for use with CloudFormation custom resource events",
          "content": [
              {
                "source": "cloudformationcustomresource.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "CodeCommitTrigger",
          "description": "Script to process AWS CodeCommit Triggers",
          "content": [
              {
                "source": "codecommittrigger.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "DetectLabels",
          "description": "Use Amazon Rekognition service to tag image files in S3 with detected labels.",
          "content": [
              {
                "source": "detectlabels.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "KinesisStreamProcessor",
          "description": "Script to be process a Kinesis Stream",
          "content": [
              {
                "source": "kinesisstreamprocessor.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "S3Event",
          "description": "Script to process S3 events",
          "content": [
              {
                "source": "s3event.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "S3EventToSNS",
          "description": "Script to process SNS Records triggered by S3 events",
          "content": [
              {
                "source": "s3tosns.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "S3EventToSNSToSQS",
          "description": "Script to process SQS Messages, subscribed to an SNS Topic that is triggered by S3 events",
          "content": [
              {
                "source": "s3tosnstosqs.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "S3EventToSQS",
          "description": "Script to process SQS Messages triggered by S3 events",
          "content": [
              {
                "source": "s3tosqs.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "SNSSubscription",
          "description": "Script to be subscribed to an SNS Topic",
          "content": [
              {
                "source": "snssubscription.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "SNSToSQS",
          "description": "Script to be subscribed to an SQS Queue, that is subscribed to an SNS Topic",
          "content": [
              {
                "source": "snstosqs.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        },
        {
          "name": "SQSQueueProcessor",
          "description": "Script to be subscribed to an SQS Queue",
          "content": [
              {
                "source": "sqsprocessor.ps1.txt",
                "output": "{basename}.ps1",
                "filetype": "lambdaFunction"
              },
              {
                "source": "readme.txt",
                "output": "readme.txt"
              }
          ]
        }
      ]
    }
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\S3Event\readme.txt Show
    This sample creates a Lambda function written in PowerShell that responds to an
    event from S3 when a new object, or object version, is created in a bucket. The
    script uses a cmdlet from the AWS Tools for PowerShell module (AWSPowerShell.NetCore)
    to read the object size and version and output them to the function logs.
    
    The script has a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example to not need cmdlets from that
    module you can safely delete this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\S3Event\s3event.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    #
    # The following link contains documentation describing the structure of the S3 event object.
    # https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.428.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    foreach ($record in $LambdaInput.Records) {
        $bucket = $record.s3.bucket.name
        $key = $record.s3.object.key
    
        Write-Host "Processing event for: bucket = $bucket, key = $key"
    
        # TODO: Add logic to handle S3 event record, for example
        $obj = Get-S3Object -Bucket $bucket -Key $key
        Write-Host "Object $key is $($obj.Size) bytes"
    }
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\S3EventToSNS\readme.txt Show
    This sample creates a Lambda function written in PowerShell that can be subscribed
    to an SNS Topic. For this sample, the SNS Topic would be subscribed to S3 Events,
    for when a new object, or object version is created in a bucket.
    
    For example: S3 Event -> SNS Topic -> Lambda Function.
    
    The script uses a cmdlet from the AWS Tools for PowerShell module
    (AWSPowerShell.NetCore) to read the object size and version and output them to
    the function logs.
    
    The script has a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example to not need cmdlets from that
    module you can safely delete this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\S3EventToSNS\s3tosns.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    #
    # The following link contains documentation describing the structure of the S3 event object.
    # https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html
    #
    # This example demonstrates how to process an S3 Event that follows the process:
    # S3 Event -> SNS Topic -> Lambda Function
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.428.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    foreach ($snsRecord in $LambdaInput.Records)
    {
        $snsMessage = ConvertFrom-Json -InputObject $snsRecord.Sns.Message
        foreach ($s3Event in $snsMessage.Records)
        {
            $bucket = $s3Event.s3.bucket.name
            $key = $s3Event.s3.object.key
    
            Write-Host "Processing event for: bucket = $bucket, key = $key"
    
            # TODO: Add logic to handle S3 event record, for example
            $obj = Get-S3Object -Bucket $bucket -Key $key
            Write-Host "Object $key is $($obj.Size) bytes"
        }
    }
  • tools\AWSLambdaPSCore\Templates\Blueprints\S3EventToSNSToSQS\readme.txt Show
    This sample creates a Lambda function written in PowerShell that can be subscribed
    to an SQS Queue. For this sample, the SQS Queue would be subscribed to an SNS Topic,
    which would be subscribed to S3 Events, for when a new object, or object version
    is created in a bucket.
    
    For example: S3 Event -> SNS Topic -> SQS Queue -> Lambda Function.
    
    The SNS Subscription can be configured for "Raw Message Delivery" or not, this sample
    is configured to handle both options.
    
    The script uses a cmdlet from the AWS Tools for PowerShell module
    (AWSPowerShell.NetCore) to read the object size and version and output them to
    the function logs.
    
    The script has a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example to not need cmdlets from that
    module you can safely delete this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\S3EventToSNSToSQS\s3tosnstosqs.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    #
    # The following link contains documentation describing the structure of the S3 event object.
    # https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html
    #
    # This example demonstrates how to process an S3 Event that follows the process:
    # S3 Event -> SNS Topic -> SQS Queue -> Lambda Function
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.428.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    #Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    foreach ($sqsRecord in $LambdaInput.Records)
    {
        $sqsRecordBody = ConvertFrom-Json -InputObject $sqsRecord.body
    
        try
        {
            # If this call works, then the SNS Subscription is configured with
            # "Raw Message Delivery" = "True"
            $snsMessage = ConvertFrom-Json -InputObject $sqsRecordBody.Message
        }
        catch
        {
            # If we hit the catch statement, then the SNS Subscription is configured
            # with "Raw Message Delivery" = "False"
            $snsMessage = $sqsRecordBody
        }
    
        if ($snsMessage.Records.Count -gt 0)
        {
            # We have an array of SNS Records, lets process them
    
            foreach ($s3Event in $snsMessage.Records)
            {
                $bucket = $s3Event.s3.bucket.name
                $key = $s3Event.s3.object.key
    
                Write-Host 'Processing event for:' (ConvertTo-Json -InputObject @{Bucket = $bucket; Key = $key} -Compress)
    
                # TODO: Add logic to handle S3 event record, for example
                $obj = Get-S3Object -Bucket $bucket -Key $key
                Write-Host "Object $key is $($obj.Size) bytes"
            }
        }
        else
        {
            # We likely have an S3 Test Event, write it out to logs
            Write-Host 'SNS Message:' (ConvertTo-Json -InputObject $snsMessage -Compress)
        }
    }
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\S3EventToSQS\readme.txt Show
    This sample creates a Lambda function written in PowerShell that can be subscribed
    to an SQS Queue. For this sample, the SQS Queue would be subscribed to S3 Events,
    for when a new object, or object version is created in a bucket.
    
    For example: S3 Event -> SQS Queue -> Lambda Function.
    
    The script uses a cmdlet from the AWS Tools for PowerShell module
    (AWSPowerShell.NetCore) to read the object size and version and output them to
    the function logs.
    
    The script has a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example to not need cmdlets from that
    module you can safely delete this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\S3EventToSQS\s3tosqs.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    #
    # The following link contains documentation describing the structure of the S3 event object.
    # https://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html
    #
    # This example demonstrates how to process an S3 Event that follows the process:
    # S3 Event -> SQS Queue -> Lambda Function
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.428.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    foreach ($sqsRecord in $LambdaInput.Records)
    {
        $sqsRecordBody = ConvertFrom-Json -InputObject $sqsRecord.body
        foreach ($s3Event in $sqsRecordBody.Records)
        {
            $bucket = $s3Event.s3.bucket.name
            $key = $s3Event.s3.object.key
    
            Write-Host "Processing event for: bucket = $bucket, key = $key"
    
            # TODO: Add logic to handle S3 event record, for example
            $obj = Get-S3Object -Bucket $bucket -Key $key
            Write-Host "Object $key is $($obj.Size) bytes"
        }
    }
  • tools\AWSLambdaPSCore\Templates\Blueprints\SNSSubscription\readme.txt Show
    This sample creates a Lambda function written in PowerShell that can be subscribed
    to an SNS Topic. The script will process each record published to the SNS Topic.
    
    The script has a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example and it does not need cmdlets from that
    module you can safely delete this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\SNSSubscription\snssubscription.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.335.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    # An SNS Subscription can receive multiple SNS records in a single execution.
    foreach ($record in $LambdaInput.Records) {
        $subject = $record.Sns.Subject
        $message = $record.Sns.Message
    }
  • tools\AWSLambdaPSCore\Templates\Blueprints\SNSToSQS\readme.txt Show
    This sample creates a Lambda function written in PowerShell that can be subscribed
    to an SQS Queue. For this sample, the SQS Queue would be subscribed to an SNS Topic.
    
    For example: SNS Topic -> SQS Queue -> Lambda Function.
    
    Assuming the Lambda function does not throw an exception, the SQS Message will be
    removed from the SQS Queue by AWS. For more information, please review "Using AWS
    Lambda with Amazon SQS" (https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html).
    
    The scripts have a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example to not need cmdlets from that
    module you can safely delete this statement.
  • tools\AWSLambdaPSCore\Templates\Blueprints\SNSToSQS\snstosqs.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    #
    # This example demonstrates how to process an SNS Message that follows the process:
    # SNS topic -> SQS Queue -> Lambda Function
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.428.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    foreach ($sqsRecord in $LambdaInput.Records)
    {
        $snsRecord = ConvertFrom-Json -InputObject $sqsRecord.body
    
        # TODO: Add logic to process each SNS Record
        Write-Host $snsRecord.Message
    }
  • tools\AWSLambdaPSCore\Templates\Blueprints\SQSQueueProcessor\readme.txt Show
    This sample creates a Lambda function written in PowerShell that can be subscribed
    to an SQS Queue.
    
    For example: SQS Queue -> Lambda Function.
    
    Assuming the Lambda function does not throw an exception, the SQS Message will be
    removed from the SQS Queue by AWS. For more information, please review "Using AWS
    Lambda with Amazon SQS" (https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html).
    
    The scripts have a Requires statement for the latest version of the AWS Tools for
    PowerShell module. If you modify this example to not need cmdlets from that
    module you can safely delete this statement.
    
  • tools\AWSLambdaPSCore\Templates\Blueprints\SQSQueueProcessor\sqsprocessor.ps1.txt Show
    # PowerShell script file to be executed as a AWS Lambda function.
    #
    # When executing in Lambda the following variables will be predefined.
    #   $LambdaInput - A PSObject that contains the Lambda function input data.
    #   $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment.
    #
    # The last item in the PowerShell pipeline will be returned as the result of the Lambda function.
    #
    # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement
    # indicating the module and version.
    #
    # This example demonstrates how to process an SQS Queue:
    # SQS Queue -> Lambda Function
    
    #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.428.0'}
    
    # Uncomment to send the input event to CloudWatch Logs
    # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5)
    
    foreach ($message in $LambdaInput.Records)
    {
        # TODO: Add logic to handle each SQS Message
        Write-Host $message.body
        Write-Host $message.messageAttributes
    }
    
  • tools\chocolateyBeforeModify.ps1 Show
    $ErrorActionPreference = 'Stop'
    
    $moduleName = $env:ChocolateyPackageName      # this could be different from package name
    Remove-Module -Name $moduleName -Force -ErrorAction SilentlyContinue
  • tools\chocolateyInstall.ps1 Show
    $ErrorActionPreference = 'Stop'
    
    $toolsDir   = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
    $moduleName = $env:ChocolateyPackageName  # this may be different from the package name and different case
    $moduleVersion = $env:ChocolateyPackageVersion
    
    # module may already be installed outside of Chocolatey
    Remove-Module -Name $moduleName -Force -ErrorAction SilentlyContinue
    
    $manifestFile = Join-Path -Path $toolsDir -ChildPath "$moduleName\$moduleName.psd1"
    
    $sourcePath = Join-Path -Path $toolsDir -ChildPath "$modulename\*"
    $destPath   = Join-Path -Path $env:ProgramFiles -ChildPath "PowerShell\Modules\$moduleName\$moduleVersion"
    
    # if a forced install we need to remove the current files because it will fail otherwise
    if (Test-Path ($destPath)) {
        Write-Verbose "Removing existing files in '$destPath'."
        Remove-Item $destPath -Recurse -Force
    }
    
    Write-Verbose "Creating destination directory '$destPath' for module."
    New-Item -Path $destPath -ItemType Directory -Force -ErrorAction SilentlyContinue | Out-Null
    
    Write-Verbose "Moving '$moduleName' files from '$sourcePath' to '$destPath'."
    Move-Item -Path $sourcePath -Destination $destPath -Force
    
    Write-Host "AWSLambdaPSCore module requires, and must be run from, PowerShell Core." -ForegroundColor Cyan
  • tools\chocolateyUninstall.ps1 Show
    $ErrorActionPreference = 'Stop'
    
    $moduleName = $env:ChocolateyPackageName
    $sourcePath = Join-Path -Path $env:ProgramFiles -ChildPath "PowerShell\Modules\$moduleName"
    
    Write-Verbose "Removing all version of '$moduleName' from '$sourcePath'."
    Remove-Item -Path $sourcePath -Recurse -Force -ErrorAction SilentlyContinue
  • tools\LICENSE.txt Show
    From https://github.com/aws/aws-lambda-dotnet/blob/master/LICENSE
    
                                     Apache License
                               Version 2.0, January 2004
                            http://www.apache.org/licenses/
    
       TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    
       1. Definitions.
    
          "License" shall mean the terms and conditions for use, reproduction,
          and distribution as defined by Sections 1 through 9 of this document.
    
          "Licensor" shall mean the copyright owner or entity authorized by
          the copyright owner that is granting the License.
    
          "Legal Entity" shall mean the union of the acting entity and all
          other entities that control, are controlled by, or are under common
          control with that entity. For the purposes of this definition,
          "control" means (i) the power, direct or indirect, to cause the
          direction or management of such entity, whether by contract or
          otherwise, or (ii) ownership of fifty percent (50%) or more of the
          outstanding shares, or (iii) beneficial ownership of such entity.
    
          "You" (or "Your") shall mean an individual or Legal Entity
          exercising permissions granted by this License.
    
          "Source" form shall mean the preferred form for making modifications,
          including but not limited to software source code, documentation
          source, and configuration files.
    
          "Object" form shall mean any form resulting from mechanical
          transformation or translation of a Source form, including but
          not limited to compiled object code, generated documentation,
          and conversions to other media types.
    
          "Work" shall mean the work of authorship, whether in Source or
          Object form, made available under the License, as indicated by a
          copyright notice that is included in or attached to the work
          (an example is provided in the Appendix below).
    
          "Derivative Works" shall mean any work, whether in Source or Object
          form, that is based on (or derived from) the Work and for which the
          editorial revisions, annotations, elaborations, or other modifications
          represent, as a whole, an original work of authorship. For the purposes
          of this License, Derivative Works shall not include works that remain
          separable from, or merely link (or bind by name) to the interfaces of,
          the Work and Derivative Works thereof.
    
          "Contribution" shall mean any work of authorship, including
          the original version of the Work and any modifications or additions
          to that Work or Derivative Works thereof, that is intentionally
          submitted to Licensor for inclusion in the Work by the copyright owner
          or by an individual or Legal Entity authorized to submit on behalf of
          the copyright owner. For the purposes of this definition, "submitted"
          means any form of electronic, verbal, or written communication sent
          to the Licensor or its representatives, including but not limited to
          communication on electronic mailing lists, source code control systems,
          and issue tracking systems that are managed by, or on behalf of, the
          Licensor for the purpose of discussing and improving the Work, but
          excluding communication that is conspicuously marked or otherwise
          designated in writing by the copyright owner as "Not a Contribution."
    
          "Contributor" shall mean Licensor and any individual or Legal Entity
          on behalf of whom a Contribution has been received by Licensor and
          subsequently incorporated within the Work.
    
       2. Grant of Copyright License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          copyright license to reproduce, prepare Derivative Works of,
          publicly display, publicly perform, sublicense, and distribute the
          Work and such Derivative Works in Source or Object form.
    
       3. Grant of Patent License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          (except as stated in this section) patent license to make, have made,
          use, offer to sell, sell, import, and otherwise transfer the Work,
          where such license applies only to those patent claims licensable
          by such Contributor that are necessarily infringed by their
          Contribution(s) alone or by combination of their Contribution(s)
          with the Work to which such Contribution(s) was submitted. If You
          institute patent litigation against any entity (including a
          cross-claim or counterclaim in a lawsuit) alleging that the Work
          or a Contribution incorporated within the Work constitutes direct
          or contributory patent infringement, then any patent licenses
          granted to You under this License for that Work shall terminate
          as of the date such litigation is filed.
    
       4. Redistribution. You may reproduce and distribute copies of the
          Work or Derivative Works thereof in any medium, with or without
          modifications, and in Source or Object form, provided that You
          meet the following conditions:
    
          (a) You must give any other recipients of the Work or
              Derivative Works a copy of this License; and
    
          (b) You must cause any modified files to carry prominent notices
              stating that You changed the files; and
    
          (c) You must retain, in the Source form of any Derivative Works
              that You distribute, all copyright, patent, trademark, and
              attribution notices from the Source form of the Work,
              excluding those notices that do not pertain to any part of
              the Derivative Works; and
    
          (d) If the Work includes a "NOTICE" text file as part of its
              distribution, then any Derivative Works that You distribute must
              include a readable copy of the attribution notices contained
              within such NOTICE file, excluding those notices that do not
              pertain to any part of the Derivative Works, in at least one
              of the following places: within a NOTICE text file distributed
              as part of the Derivative Works; within the Source form or
              documentation, if provided along with the Derivative Works; or,
              within a display generated by the Derivative Works, if and
              wherever such third-party notices normally appear. The contents
              of the NOTICE file are for informational purposes only and
              do not modify the License. You may add Your own attribution
              notices within Derivative Works that You distribute, alongside
              or as an addendum to the NOTICE text from the Work, provided
              that such additional attribution notices cannot be construed
              as modifying the License.
    
          You may add Your own copyright statement to Your modifications and
          may provide additional or different license terms and conditions
          for use, reproduction, or distribution of Your modifications, or
          for any such Derivative Works as a whole, provided Your use,
          reproduction, and distribution of the Work otherwise complies with
          the conditions stated in this License.
    
       5. Submission of Contributions. Unless You explicitly state otherwise,
          any Contribution intentionally submitted for inclusion in the Work
          by You to the Licensor shall be under the terms and conditions of
          this License, without any additional terms or conditions.
          Notwithstanding the above, nothing herein shall supersede or modify
          the terms of any separate license agreement you may have executed
          with Licensor regarding such Contributions.
    
       6. Trademarks. This License does not grant permission to use the trade
          names, trademarks, service marks, or product names of the Licensor,
          except as required for reasonable and customary use in describing the
          origin of the Work and reproducing the content of the NOTICE file.
    
       7. Disclaimer of Warranty. Unless required by applicable law or
          agreed to in writing, Licensor provides the Work (and each
          Contributor provides its Contributions) on an "AS IS" BASIS,
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
          implied, including, without limitation, any warranties or conditions
          of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
          PARTICULAR PURPOSE. You are solely responsible for determining the
          appropriateness of using or redistributing the Work and assume any
          risks associated with Your exercise of permissions under this License.
    
       8. Limitation of Liability. In no event and under no legal theory,
          whether in tort (including negligence), contract, or otherwise,
          unless required by applicable law (such as deliberate and grossly
          negligent acts) or agreed to in writing, shall any Contributor be
          liable to You for damages, including any direct, indirect, special,
          incidental, or consequential damages of any character arising as a
          result of this License or out of the use or inability to use the
          Work (including but not limited to damages for loss of goodwill,
          work stoppage, computer failure or malfunction, or any and all
          other commercial damages or losses), even if such Contributor
          has been advised of the possibility of such damages.
    
       9. Accepting Warranty or Additional Liability. While redistributing
          the Work or Derivative Works thereof, You may choose to offer,
          and charge a fee for, acceptance of support, warranty, indemnity,
          or other liability obligations and/or rights consistent with this
          License. However, in accepting such obligations, You may act only
          on Your own behalf and on Your sole responsibility, not on behalf
          of any other Contributor, and only if You agree to indemnify,
          defend, and hold each Contributor harmless for any liability
          incurred by, or claims asserted against, such Contributor by reason
          of your accepting any such warranty or additional liability.
    
       END OF TERMS AND CONDITIONS
    
       APPENDIX: How to apply the Apache License to your work.
    
          To apply the Apache License to your work, attach the following
          boilerplate notice, with the fields enclosed by brackets "{}"
          replaced with your own identifying information. (Don't include
          the brackets!)  The text should be enclosed in the appropriate
          comment syntax for the file format. We also recommend that a
          file or class name and description of purpose be included on the
          same "printed page" as the copyright notice for easier
          identification within third-party archives.
    
       Copyright {yyyy} {name of copyright owner}
    
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
    
           http://www.apache.org/licenses/LICENSE-2.0
    
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
    
  • tools\VERIFICATION.txt Show
    VERIFICATION
    Verification is intended to assist the Chocolatey moderators and community in verifying that this package's contents are trustworthy.
    
    To verify the files using the project source:
    
    1. Please go to the project source location (https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell) and download the source files;
    3. Use Get-FileHash -Path <FILE TO VERIFY> to get the file hash value from both the built file (from step 1 above) and the file from the package and compare them;
    
    Alternatively you can download the module from the PowerShell Gallery ...
    
        Save-Module -Name AWSLambdaPSCore -Path <PATH TO DOWNLOAD TO>
    
    ... and compare the files from the package against those in the installed module. Again use Get-FileHash -Path <FILE TO VERIFY> to retrieve those hash values.

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

This package has no dependencies.

Package Maintainer(s)

Software Author(s)

  • Amazon.com Inc

Copyright

Copyright 2012-2018 Amazon.com, Inc.

Tags

Version History

Version Downloads Last updated Status
AWS Lambda for PowerShell Core (PowerShell Module) 1.1.0.0 45 Thursday, November 22, 2018 approved

Discussion for the AWS Lambda for PowerShell Core (PowerShell Module) Package

Ground rules:

  • This discussion is only about AWS Lambda for PowerShell Core (PowerShell Module) and the AWS Lambda for PowerShell Core (PowerShell Module) package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or AWS Lambda for PowerShell Core (PowerShell Module), or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus
Chocolatey.org uses cookies to enhance the user experience of the site.
Ok