We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PnP-RemoveFileVersion is able to process encoded URLs
PnP-RemoveFileVersion
Remove-PnPFileVersion errors if the URL provided contains any encoded characters, e.g. %20 instead of ' '
Remove-PnPFileVersion
%20
' '
Get link to file from UI or other means and save relative url, for example: https://contoso.sharepoint.com/sites/test/Shared%20Documents/Test%20document.docx $SiteUrl = "https://contoso.sharepoint.com/sites/test" $FileUrl = "Shared%20Documents/Test%20document.docx"
$SiteUrl = "https://contoso.sharepoint.com/sites/test"
$FileUrl = "Shared%20Documents/Test%20document.docx"
Connect to SharePoint and validate file URL Connect-PnPOnline -Url $SiteUrl (PnP-GetFile $FileUrl).Id > 1234 (Success)
Connect-PnPOnline -Url $SiteUrl
(PnP-GetFile $FileUrl).Id
> 1234 (Success)
Try to delete file versions PnP-RemoveFileVersion -All -Force -Url $FileUrl => PnP-RemoveFileVersion -All -Force -Url "Shared%20Documents/Test%20document.docx" > Remove-PnPFileVersion: File not found (Error)
PnP-RemoveFileVersion -All -Force -Url $FileUrl
=> PnP-RemoveFileVersion -All -Force -Url "Shared%20Documents/Test%20document.docx"
> Remove-PnPFileVersion: File not found (Error)
Try to delete file versions with decoded URL $FileUrl = [System.Web.HttpUtility]::UrlDecode($FileUrl) PnP-RemoveFileVersion -All -Force -Url $FileUrl => PnP-RemoveFileVersion -All -Force -Url "Shared Documents/Test document.docx" > (Success)
$FileUrl = [System.Web.HttpUtility]::UrlDecode($FileUrl)
=> PnP-RemoveFileVersion -All -Force -Url "Shared Documents/Test document.docx"
> (Success)
2.12.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Expected behavior
PnP-RemoveFileVersion
is able to process encoded URLsActual behavior
Remove-PnPFileVersion
errors if the URL provided contains any encoded characters, e.g.%20
instead of' '
Steps to reproduce behavior
Get link to file from UI or other means and save relative url, for example:
https://contoso.sharepoint.com/sites/test/Shared%20Documents/Test%20document.docx
$SiteUrl = "https://contoso.sharepoint.com/sites/test"
$FileUrl = "Shared%20Documents/Test%20document.docx"
Connect to SharePoint and validate file URL
Connect-PnPOnline -Url $SiteUrl
(PnP-GetFile $FileUrl).Id
> 1234 (Success)
Try to delete file versions
PnP-RemoveFileVersion -All -Force -Url $FileUrl
=> PnP-RemoveFileVersion -All -Force -Url "Shared%20Documents/Test%20document.docx"
> Remove-PnPFileVersion: File not found (Error)
Try to delete file versions with decoded URL
$FileUrl = [System.Web.HttpUtility]::UrlDecode($FileUrl)
PnP-RemoveFileVersion -All -Force -Url $FileUrl
=> PnP-RemoveFileVersion -All -Force -Url "Shared Documents/Test document.docx"
> (Success)
What is the version of the Cmdlet module you are running?
2.12.0
Which operating system/environment are you running PnP PowerShell on?
The text was updated successfully, but these errors were encountered: