Having to copy some files using robocopy and coming across some errors due to illegal characters. Normally, ft it is the same type of issue, e.g. - always a trailing space, or always a trailing dot, I would rename them targeting and trimming the particular problem character. However, this time I have come across a folder with all sorts of different characters, mostly standing for emojis in a .msg file name, like this:

Is there a way to strip the illegal characters from the name? How do I generate a name using only allowed characters and dropping or replacing anything else?
Thank you!