Forum Discussion

PRebelo's avatar
PRebelo
Copper Contributor
Aug 02, 2023

Unable to retrieve version history of a file.

$file = Get-PnPFile -Url "https://???/sites/???/Shared%20Documents/some-file.docx"
correctly returns the file object.

$versions = Get-PnPProperty -ClientObject $file -Property Versions

Get-PnPProperty : The object id "site:???:web:???:file:/sites/???/https:
//???/sites/???/Shared Documents/some-file.docx" is invalid.
At line:1 char:13
+ $versions = Get-PnPProperty -ClientObject $file -Property Versions
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Get-PnPProperty], ServerException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Base.EnsureProperty

 

This is consistent for different files in different tenants that I have tested.

Am using PnP PowerShell v1.1.10

No RepliesBe the first to reply

Resources