This commit is contained in:
Alexander 2024-09-15 02:45:07 -04:00
parent 5d28e7c1af
commit 5454115c16

17
assets/rename.ps1 Normal file
View File

@ -0,0 +1,17 @@
<#
.SYNOPSIS
Renames files
Written by: Alexander Bobkov
Date: Sep 15, 2024
#>
# Script
Get-ChildItem -Path . -Filter "*.txt" | forEach-Object {
Rename-Item -Path $_.Name -NewName $_.Name.Replace("txt", "bat") -Verbose
Write-Host $_.Name
}
# One-liner
#Get-ChildItem -Path . -Recurse -Include "*.txt" | Rename-Item -NewName { $_.Name -replace ".txt", ".bat" }