I suspect this affects all cmdlets accepting a -FolderPath parameter, I'm also not sure it's worth fixing because I'm probably the only person dumb enough to run into it.
A folder with just the name of \ is legal in Projectwise.
However you specify this folder in your folder path, -FolderPath treats it as if it ended in a single \ and refers to the parent folder rather than the folder named \
This causes us problems as well as the users are using legal characters but pwps(*?) doesn't handle literal strings. We have to transform them to ones that work.
Have you tried pre-processing folder paths so that chars in the list above have \ added to escape them? That could end up with a path like \Bad Folders\\\Meh
My script recurses into each folder so I've already retrieved the folder info, i flipped my function from using FolderPath to using FolderID and it was fine.
I just did some more testing and no escaping mechanism i'm aware of (precedding with \ ` or ^) worked. For folders where the name ends in \, \\\ did not work. I also did some additional testing with the slash in the middle of a name (I know we have folders named this way) and they also failed.
FolderID or Folder GUID seems to be the only work-around.