20-05-22 07:58 AM
23-05-22 01:51 PM
23-05-22 03:21 PM
Hello @ewilson Thanks for your reply. i am having below version of power shell.
Name Value
---- -----
PSVersion 5.1.19041.1682
Are you pointing that Powershell v7 will make the command share by me run well( Folder have space in name as well )? or there are other thing i need to do.
23-05-22 04:29 PM
# The following two lines capture the path where the PowerShell script resides. This is necessary in order to
# run this script within the PowerShell ISE w/o having to hardcode my specific folder layout.
$scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
#'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# DEPLOYMENT PACKAGE DEFINITIONS
#
# You must add a new entry for any new Lambda function you define.
#'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
$lambda_DeleteUser = @{
Path = "$dir\TestServices DeleteUser\node_modules", "$dir\TestServices DeleteUser\*.js", "$dir\TestServices DeleteUser\*.json"
CompressionLevel = "Fastest"
DestinationPath = "$dir\Deployment Packages\TestServices_DeleteUser.zip"
}
$lambda_GetUser = @{
Path = "$dir\TestServices GetUser\node_modules", "$dir\TestServices GetUser\*.js", "$dir\TestServices GetUser\*.json"
CompressionLevel = "Fastest"
DestinationPath = "$dir\Deployment Packages\TestServices_GetUser.zip"
}
#'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# BUILD DEPLOYMENT PACKAGES
#
# Use the Compress-Archive cmdlet to build the deployment package
# (aka zip archive) for each Lambda function.
#'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Compress-Archive @lambda_DeleteUser -Force
Compress-Archive @lambda_GetUser -Force
As you can see, I have spaces in my folder paths (there are actually more spaces included in the $dir variable. This works fine for me.
Cheers,