Open GamalielCorona opened 3 years ago
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
+ CategoryInfo : WriteError: (:) [Restore-PnPFileVersion], ServerUnauthorizedAccessException + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Files.RestoreFileVersion**
https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/restore-pnpfileversion?view=sharepoint-ps
Error: Access denied. You do not have permission to perform this action or access this resource.
$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
Major Minor Build Revision
3 26 2010 0
[-] 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.
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.