mirror of
https://github.com/alexandrebobkov/Components.git
synced 2024-09-19 06:56:06 -04:00
Compare commits
2 Commits
5d28e7c1af
...
579e8d849b
Author | SHA1 | Date | |
---|---|---|---|
|
579e8d849b | ||
|
5454115c16 |
20
assets/rename.ps1
Normal file
20
assets/rename.ps1
Normal 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" }
|
Loading…
Reference in New Issue
Block a user