pnp / PnP-PowerShell

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

Restore-PnPFileVersion sends permission error PnPSharePointPowerShellOnline version 3.26.20 #2989

Open GamalielCorona opened 3 years ago

GamalielCorona commented 3 years ago

Reporting an Issue or Missing Feature

Please confirm what it is that your reporting Issue: **Restore-PnPFileVersion : Access denied. You do not have permission to perform this action or access this resource. At line:1 char:3

Expected behavior

https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/restore-pnpfileversion?view=sharepoint-ps

Actual behavior

Error: Access denied. You do not have permission to perform this action or access this resource.

Steps to reproduce behavior

Connect to PnPOnline

$userCredential = Get-Credential -Message "Provide your credentials" Connect-PnPOnline -Url $strSiteCollectionURL -Credentials $userCredential Restore-PnPFileVersion -Url $fileRef -Identity 'Version 1.0'

[-] PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

Major Minor Build Revision


3 26 2010 0

How did you install the PnP-PowerShell Cmdlets?

[-] Installed through the PowerShell Gallery with Install-Module

I have also tried by the SPO client and the command it does change the version but doesn't restore the file-version as expected

$file.Versions.RestoreByLabel($vLabel) $ctx.ExecuteQuery()

This command doesn't restore the file only add a new version on the file.