MSH: lowercase-ify files in a directory
Windows, as a rule, isn't case-sensitive, and as a result, 90+% of people who use computers don't even know what "case-sensitive" means.
When copying files from one host to another, "FILE.TXT" and "file.txt" may have the exact same checksum, but they're going to be immediately discounted as different files because of their different names. To help mitigate this problem, here is a one-liner in MSH that renames each file in a directory to lowercase:
MSH>foreach ($i in get-childitem) {
[String] $s = $i;
$s = $s.tolower();
move $i $s;
echo $s
}
Edited for readability, though it is now technically no longer a "one-liner".
No comments:
Post a Comment