Forum Discussion

EAMJW999's avatar
EAMJW999
Copper Contributor
Mar 15, 2021

Only Allow A-Za-z0-9 and spaces (how?)

Hi,

 

This powershell command removes all characters from a filename except A-Za-z0-9. 
Get-Item .\*.msg | Rename-Item -NewName { $($_.BaseName -replace "/W"," ") + $_.Extension }

But it also removes spaces, please help to adjust the command line into a command that only allows     A-Za-z0-9 and spaces!

 

Regards,

 

Edward

No RepliesBe the first to reply

Resources