I have a script that accepts a directory as an argument from the user. I\'d like to display the name of the directory path as it is displayed in Windows. I.e.,
<
I found a different and simpler approach using PowerShell wild cards.
$canonicalCasePath = Get-ChildItem -Path $wrongCasingPath.Replace("\","\*") | Where FullName -IEQ $wrongCasingPath | Select -ExpandProperty FullName