cancel
Showing results for 
Search instead for 
Did you mean: 

Start Process Action - PowerShell command

Neel1
MVP
hello, I am trying to run below stuff in start process but it is not executing.

data item d contain folder path to zip
data item c contain zip folder path

what I am missing here?  i want to run specifically using below action/VBO.

24212.png

------------------------------
Neeraj Kumar
Technical Architect
------------------------------
12 REPLIES 12

Hi @Neeraj Kumar,

First question would be do you know if you have multiple versions of PowerShell installed on the machine? In my case, there's the legacy PowerShell that's included with Windows. I also have PowerShell v7 (aka PowerShell Core) installed. What I've found is that PowerShell v7 seems to execute faster than legacy PowerShell.

From the process folder shown in your screenshot it looks like you're invoking legacy PowerShell. I've tested with that, using a ps1 script file that zips multiple folders into separate archives. These are relatively small, although they do include some NodeJS modules (ex. MySQL) in them. ​The final archives are about 352KB in size. Legacy PowerShell takes about 15-30 seconds to complete. Running the same ps1 script through PowerShell v7 takes maybe 2-5 seconds to complete.

If you have PowerShell v7 installed you should be able to find it under C:\Program Files\PowerShell\7. The executable is pwsh.exe.

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

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.



------------------------------
Neeraj Kumar
Technical Architect
------------------------------

@Neeraj Kumar,

What I can say is that in my environment, PowerShell v7 has shown to be faster than legacy PowerShell (i.e. v5). Here's an example of the PowerShell script that I'm using for a project:

# 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,



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------