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
- $File1 = Get-PnPFile -Url $FileRelativeURL -AsListItem
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : WriteError: (:) [Get-PnPFile], ServerException
- FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Files.GetFile
Cannot index into a null array.
At line:13 char:1
- Write-Host $File1[“Batch_x0020_Date”]
-
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : NullArray
2