Feature Restore-PnPListItemVersion
###Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:###
- Are you using
Apply-PnPProvisioningTemplateorGet-PnPProvisioningTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/PnP-Sites-Core/issues. - Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
- If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/pnp/PnP-PowerShell/tree/master/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/pnp/PnP-Sites-Core/issues
Reporting an Issue or Missing Feature
Missing Feature
Expected behavior
The ability to restore a list item to a previous version (not just the exact previous version).
Actual behavior
This is not available. The Reset-PnPFileVersion has unexpected behavior and only restores to the previous version. See #2729
Trying with the Get-PnPFile to the list item and using the .Versions.ResteoreByLabel() does nothing. (Yes, .ExecuteQuery() is run on the PnPContext).
Steps to reproduce behavior
No cmdlet or method exists for PnPListItems
For PnPFile, $pnpFile = get-PnPFile -url $varToTheItemFileRef
$pnpContext.Load($pnpFile) $pnpContext.Load($pnpFile.Versions) $pnpContext.ExecuteQuery()
$pnpFile.versions.RestoreByLabel(1.0) $pnpContext.ExecuteQuery()
Which version of the PnP-PowerShell Cmdlets are you using?
- [ ] PnP PowerShell for SharePoint 2013
- [ ] PnP PowerShell for SharePoint 2016
- [ ] PnP PowerShell for SharePoint 2019
- [ x] PnP PowerShell for SharePoint Online
What is the version of the Cmdlet module you are running?
(you can retrieve this by executing Get-Module -Name sharepointpnppowershell* -ListAvailable)
3.22.2006.1
How did you install the PnP-PowerShell Cmdlets?
- [ ] MSI Installed downloaded from GitHub
- [x ] Installed through the PowerShell Gallery with Install-Module
- [ ] Other means
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.