1、新建.ps1后缀文件
$Path = 'D:\plugin'
$Filter = '*.js'
$newtext = 'abcdef'
$oldtext = 'abc'
ls $Path -Include $Filter -Recurse | ForEach-Object{Rename-Item $_.FullName$_.FullName.Replace($oldtext,$newtext)}
说明:$Path代表文件路径、$Filter指的是文件类型、$oldtext代表被替换的字符、$newtext代表替换后的字符。
2、右键.ps1文件——选择使用 PowerShell运行——完成