Run Invoke Powershell Activity With Parameters

Hi there,

I need to run an exe file with the parameters. The details are below:

Powershell command (working fine in powershell) - & “C\Test\Abc.exe” -importsettings “C\Test\Abc.2xc”

When I run this command using the Invoke Powershell activity the parameter is kind of skipping and it only opens the app with the default parameters.

I highly appreciate any help on this.

Thanks.

Hi @Himanshu_Punj

It seems like the Invoke PowerShell activity in UiPath is not passing the parameters correctly. To ensure the parameters are passed correctly, try using the ‘-File’ parameter with the PowerShell executable and then specify the script path and arguments separately. Here’s the modified command:

& "C:\Test\Abc.exe" -importsettings "C:\Test\Abc.2xc"

Or use the below one

Start-Process -FilePath "C:\Test\Abc.exe" -ArgumentList "-importsettings 'C:\Test\Abc.2xc'"

Hope it helps!!

It’s still not working. Here’s what I am exactly doing.

image

image