Powershell renaming a specific Character
问题 I've been batch renaming .las files in powershell with a simple script: cd "C:\Users\User\desktop\Folder" Dir | Rename-Item -NewName {$_.name-replace "-", "" } Dir | Rename-Item -NewName {$_.name-replace "_", "" } Dir | Rename-Item -NewName {$_.BaseName+ "0.las"} This has been working great, but I need to modify it to account for a different naming convention. The files start out in this format: 123_45-67-890-12W_ 0 and get converted to 123456789012W00.las Occasionally the number after the W