我知道我可以使用以下内容将给定文件夹中的所有文件名转换为大写:
Get-ChildItem -Path your_path -Recurse | Rename-item -NewName {$_.name.ToUpper()}
Run Code Online (Sandbox Code Playgroud)
但是,如何只将文件夹中所有文件名的前两个字母大写?
即
ls 123456_This_is_a_Test.pdf - > LS 123456_This_is_a_Test.pdf
re 98765_Another_Test.pdf - > RE 98765_Another_Test.pdf
谢谢丹
powershell ×1