Reputation: 23
I am trying to get one of the properties (Batch date) of the SharePoint online document library file. I am getting below error Any suggestion on this please.
Batch date is single line of text field having date value.
Script:
Error message:
Get-PnPFile : The object specified does not belong to a list. At line:9 char:10
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
Upvotes: 0
Views: 56
Reputation: 1
I had the same issue, and in your case because you are using the Documents library instead of using "Documents" use "shared documents", and in the var you don't need to set name of the site, then the var would be something like this:
$FileRelativeUrl="/shared documents/test.txt".
It worked for me using Power Shell 7
Upvotes: 0