sharepoint online - How to Regex remove multiple invalid characters in powershell? -
i new powershell , know if there way remove specific occurrences of invalid characters using powershell?
/ram-_tranva-_bi.pdf - in instance remove "-__" filename.
/us-lrt---atten.pdf - in instance remove "---" filename
i have tried:
-replace [-]+, ""
-replace -[3], ""
-replace "[#%*:<>?/|-_]", ""
doesn't seem work either way...
can please?
your trouble have enclose values single quotes try :
"/ram-_tranva-_bi.pdf" -replace '[-]+',''
or :
"/us-lrt---atten.pdf " -replace '[-]+','' "/us-lrt---atten.pdf " -replace '[-]3',''
Comments
Post a Comment