I'm writing a CSOM PS script to create folders in a doclib, and set permissions on them.
Anything works fine except when the folder name contains a %
I am able to create the folder using ResourcePath, FolderCollectionAddParameters and AddUsingPath following this article
But I can't get access to the folder using GetFolderByServerRelativeURL method.
The code is the following :
$folderurl="/sites/MySite/MydocLib/MyFolder %1" $rpFolder = [Microsoft.SharePoint.Client.ResourcePath]::FromDecodedUrl($folderurl) $CurrentFolder = $ctx.web.GetFolderByServerRelativeUrl($rpFolder) $Ctx.Load($CurrentFolder) $Ctx.ExecuteQuery()
And I get a "file not found" error.
Any help will be appreciated