From ffd124e3a484db17f65f0a6d62875a5d27ad5236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20B=C3=ADro?= <89740062+adrianbiro@users.noreply.github.com> Date: Fri, 10 Mar 2023 15:37:12 +0100 Subject: [PATCH] Create rename.ps1 --- rename.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 rename.ps1 diff --git a/rename.ps1 b/rename.ps1 new file mode 100644 index 0000000..f02d67b --- /dev/null +++ b/rename.ps1 @@ -0,0 +1,10 @@ +Param( + [Parameter(ValueFromPipeline=$true, Mandatory = $True)] + $Files, + [Parameter(Mandatory = $True)] + [string] $Old, + [Parameter(Mandatory = $True)] + [string] $New + +) +$Files | ForEach-Object { Move-Item $_.Name ($_.Name -replace $Old, $New ) }