Compare commits

...

2 Commits

Author SHA1 Message Date
Alexandre B
579e8d849b . 2024-09-15 02:47:29 -04:00
Alexandre B
5454115c16 . 2024-09-15 02:45:07 -04:00

20
assets/rename.ps1 Normal file
View File

@ -0,0 +1,20 @@
<#
.SYNOPSIS
Renames files
Written by: Alexander Bobkov
Date: Sep 15, 2024
#>
# Script
# Specify path and original file extention
Get-ChildItem -Path . -Filter "*.txt" | forEach-Object {
# Change file extention from original to a new one
Rename-Item -Path $_.Name -NewName $_.Name.Replace("txt", "bat") -Verbose
# Output the name of file that was renamed
Write-Host $_.Name
}
# One-liner
#Get-ChildItem -Path . -Recurse -Include "*.txt" | Rename-Item -NewName { $_.Name -replace ".txt", ".bat" }