I have the following hash table.
$m = @{
"AAA" = "XX";
"BBB" = "YY";
"CCC" = "ZZ";
....
}
I want to rename the files which names started with “AAA” to “XX….”, “BBB” to “YY….”, etc.
For example, “AAA1234.txt” will be renamed to “XX1234.txt”.
How to do it in Powershell?
This code works for me: