PowerShell acticity does not return out Argument

Hi Everyone,

I try to get a status from my script by calling the variable in Invoke PowerShell activity in PowerShellVariables pannel. In Powershell script the variable is named “Status” and in UiPath it is named “StatusRun”

Here is how I configure the activity :

image

Here is the executed script:

After the execution a message box shows the value returned by the script and it is always empty.

Can anyone help me please ?

Regards,

Hello @loirdiahmed

Hope you have already executed the powershell and validated the ouutput. Alos you have 2 input variables, so are you passing the values to powershell script properly?

Can refer to the below doc.

Hi @loirdiahmed,

Instead of passing variables you can alter you PowerShell code to get parameters and use those parameters and return your $Status value.

The way to do this is written in this tutorial