Exception calling "ShouldContinue" with "2" argument(s): "

Hi guys,

When i try to connect office 365 using PowerShell I am getting the following exception
(See the attached screenshot).

Please advise on this.

Hi @Iswarya.G

Could you share a sample project?

1 Like

Main.xaml (4.3 KB)

1 Like

I used below Script in file path(See attached Print screen)

Hello @Iswarya.G,
In your script you are importing the external PS module. I suggest to install it firstly in powershell by Install-Module MSOnline and then check if importing it in the script is working. The main problem here is that powershell is waiting for input during the import like in the screen below:

UiPath Studio can’t properly use it and just throws an error.

EDIT: Install it running PS with ‘as an Administrator’ option.

1 Like

Hi @Pablito,

I already installed the MSOnline module. The same script working fine in PowerShell. But, the problem is PS is not working in Uipath.

One thing which is worth to try. Please try to open studio with this workflow ‘as an Administrator’. Seems that studio is working with invokes in a kind of Sandbox which is disabling some let’s say non standard features.

1 Like

I tried it already @Pablito. But again i got an exception only.

I got the below exception.

@Iswarya.G try the same but please mark IsScript in the options for the activity.

1 Like

@Pablito, I tried all the scenarios But, I didn’t get the exact result.

Will try to take closer look into this case. Will back to you as soon as I will have something.

Hello Again @Iswarya.G,
We got nice tutorial made by @huston8

Try to do it this way by saving your script into text file and invoke PowerShell with use of output from Read Text File activity.