I recently started messing with SharePoint Foundation 2013 here at work. I started copying some folders/files over and almost immediately ran into an issue with folders/files throwing errors due to there being illegal characters in the folder/file names.
I'm now looking for a way to rename any and all folders/files that contain an ampersand in the name.
I'm hoping someone here could help me with creating a script for this. I'm thinking it would need to consist of 2 "parts" due to some folder/file names having a space before/after the ampersand and other folder/file names having no space before/after the ampersand.
Essentially, I'm looking to have a script created that can do the following on a Windows Server OS:
- search a folder and all sub-folders for any and all folders and filenames containing space&space <-- example file/folder name Alligators & Crocodiles
- rename these folders/files spaceandspace <-- example file/folder name Alligators and Crocodiles
- search the same series of folders for any and all folders and files containing no space&no space <-- example file/folder name Up&Down
- rename these folders/files spaceandspace <-- example file/folder name Up and Down
I'd appreciate any help you could provide me with.