pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

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" #2883

Open guptarajesh001 opened 4 years ago

guptarajesh001 commented 4 years ago

When we run the below script on the Powershell version 5.1 for fetching the 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 successfully with non workflow.

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"