| Yêu cầu | Thao tác | Lệnh | Demo | Ghi chú | Ví dụ |
| mở power shell ở một folder | Shift+chuật phải | cd “path folder” | |||
| Tên file | |||||
| Chuyển tất cả tên file thành chữ hoa | Dir -Recurse | Rename-Item -NewName {$_.BaseName.ToUpper() + $_.Extension.ToUpper()} | ||||
| Chuyển tất cả tên file thành chữ thường | Dir -Recurse | Rename-Item -NewName {$_.BaseName.Tolower() + $_.Extension.Tolower()} | ||||
| Thay thế một ký tự trong tên file | dir | Rename-Item -NewName {$_.name -replace “ký tự bị thay thế”, “ký tự được thay thế”} | Không ghi đè Thêm dấu gạch chéo \trước ký tự đặc biệt (){}[] để thay thế | dir | Rename-Item -NewName {$_.name -replace ” “, “-“} | ||
| thêm ký tự vào đầu tên file | dir -exclude “add text*” | Rename-Item -NewName {“add text” + $_.name} | dir -exclude “du-an-biet-thu-binh-chanh-*” | Rename-Item -NewName {“vu khi genshin impact ” + $_.name} | |||
| thêm ký tự vào cuối tên file | dir | Rename-Item -NewName {$_.basename + “-tuong-lien-quan-mobile” + $_.extension} | dir | Rename-Item -NewName {$_.basename + “-thanh-di-vat-genshin-impact” + $_.extension} | |||
| Tạo hàng loạt thư mục | |||||
| “thu muc 1”, “thu muc 2″,”thu muc 3” | %{New-Item -Name “$_” -ItemType “Directory”} | |||||
| thay thế số ký tự trong hàng loạt file | |||||
| get-childitem *.mp3 | foreach { rename-item $_ $_.Name.Replace(“ký tự bị thay thế”, “ký tự thay thế”) } | get-childitem *.png | foreach { rename-item $_ $_.Name.Replace(“-“, ” “) } | ||||
| xoá một số ký tự trong hàng loạt file | |||||
| get-childitem *.mp3 | foreach { rename-item $_ $_.Name.Replace(“ký tự cần xoá”, “”) } | |||||
| Đổi tên file thành chữ thường | |||||
| Get-ChildItem *.jpg | Rename-Item -NewName {$_.FullName.ToLower()} | |||||