JSON serialization exception when executing powershell script

Hi,

Can someone help me here ?
I am trying to run a shell script from studio to upload files to sharepoint.
But I am facing two issues:
1.When i give the sharepoint URL as SiteURL variable in variable panel, below is the error
Message: Error resolving type specified in JSON ‘Microsoft.SharePoint.Client.ClientRequestException, Microsoft.SharePoint.Client.Runtime’. Path ‘$type’, line 1, position 1100.

  1. When URL is specified in the script file as
    [string] $SiteURL = “sharepoint URL here”
    Then the error occurs as below
    Message: Exception calling “.ctor” with “1” argument(s): “Value does not fall within the expected range.”

for the first error, validate your JSON data using an online verifier. it will identify where the issue appears

I have a valid JSON file.
But still facing the below error while trying to run the power shell script.

Exception calling “ExecuteQuery” with “0” argument(s): “The operation has timed out”
At C:\Users\srangas\Desktop\sharepoint.ps1:47 char:5

  • $Context.ExecuteQuery()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:slight_smile: , MethodInvocationException
    • FullyQualifiedErrorId : WebException

Have you tried to increase the powershell timeout settings?

I have introduced a timeout in the code as below:
$Context.RequestTimeout = 60000

Kindly share me any sample code if you have.

I have not used powershell/sharepoint/uipath in such an integrated way. I suspect its a powershell to sharepoint issue and not UiPath related.

Thanks.!
Let me check.