Last active
January 14, 2021 12:58
-
-
Save mknet/268017ad3adc7a4de185cbc19925307b to your computer and use it in GitHub Desktop.
Remove a string in a filename using Windows' PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param ( | |
[Parameter(Mandatory=$true)][string]$ToBeReplaced | |
) | |
echo $ToBeReplaced | |
dir | rename-item -NewName {$_.name -replace $ToBeReplaced,""} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment