Remove invalid characters from filenames
CraigHume opened this issue · 0 comments
CraigHume commented
Backup of security baselines for MMD failing due to invalid characters in the name. in my own script I got around via following, but would much prefer you incorporate into your excellent module:
$invalidcharacters = @('/','$','[',']','{','{','~','#','!','?',':','(',')','}','{','&')
Foreach($chr in $invalidcharacters)
{
$name = $name.replace($chr,"")
}
$name = $name.TrimStart(" ")