Cannot convert the "Microsoft.SharePoint.Client.ListItem" value of type "Microsoft.SharePoint.Clien

Copper Contributor

When we run the below script on the Power shell version 5.1 for fetching file property.

 

 

 

 

  workflow IterateWorkflow 
{
    Parallel {
        Connect-PnPOnline -Url $SrcFolderURL -Credentials  $creds -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
        $folderUrl = "/Documents/It's a level 3 folder for testing/Level 4/file-sample_100kB.doc"
        $file = Get-PnPFile -Url $folderUrl -AsListItem
        if ($file) {
            Get-PnPProperty -ClientObject $file -Property HasUniqueRoleAssignments, RoleAssignments
        }
        else {
            $file = Get-PnPFile -Url $folderUrl -AsListItem
            Get-PnPProperty -ClientObject $file -Property HasUniqueRoleAssignments, RoleAssignments
        }
    }
}

 

 

 

 

We are getting Microsoft related issue,  however, its running successful on non-workflow the Power Shell.

 

 

 

Cannot bind parameter 'ClientObject'. Cannot convert the "Microsoft.SharePoint.Client.ListItem" value of type "Deserialized.Microsoft.SharePoint.Client.ListItem" to type "Microsoft.SharePoint.Client.ClientObject"

 

 

0 Replies