pnp / PnP-PowerShell

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

[BUG] Issue with Move-PnPFile and Resolve-PnPFolder when name includes a Pound Sign #2995

Open alvaroyurrita opened 3 years ago

alvaroyurrita commented 3 years ago

Reporting an Issue or Missing Feature

Sharepoint Document repositories accept now the # special character. However both the Add-PnPFolder and Resolve-PnPFolder will fail when trying to add a folder with a name that contains #.

Furthermore, when moving a folder with a # character using the Move-PnPFile, it will be successful if the move is within the same Repository, but it will fail if it is trying to move it to a different site/repository. It will actually copy the Folder, but it will not delete it from the source site.

Expected behavior

Add-PnPFolder, Resolve-PnPFolder, Move-PnPFolder should support folder with the # character, to replicate the behavior using the Sharepoint site.

Steps to reproduce behavior

$Src = "/sites/{Site}/Shared Documents/General/Bulletins/2019.03.21 Bulletin #1"   
$Dst = "/sites/{Site}/Projects 2019/Completed Projects/Bulletins"     
Move-PnPFile -ServerRelativeUrl $Src -TargetServerRelativeLibrary $Dst
$Dst = "/sites/{Site}/Projects 2019/Completed Projects/Bulletins/2019.03.21 Bulletin #1"     
Resolve-PnPFolder -SiteRelativePath $Dst
$Dir = "/sites/{Site}/Projects 2019/Completed Projects/Bulletins"
$Name = "2019.03.21 Bulletin #1"
Add-PnPFolder -Name $Name -Folder $Dir

Which version of the PnP-PowerShell Cmdlets are you using?

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

Name              : SharePointPnPPowerShellOnline
Path              : C:\Program Files\WindowsPowerShell\Modules\SharePointPnPPowerShellOnline\3.26.2010.0\SharePointPnPPowerShellOnline.psd1
Description       : Microsoft 365 Patterns and Practices PowerShell Cmdlets for SharePoint Online
ModuleType        : Binary
Version           : 3.26.2010.0

How did you install the PnP-PowerShell Cmdlets?