Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Test-Path doesn't found localised folder names

I’m currently working in an environment with the culture set to "$PSCulture de-DE". When I execute the command:

Test-Path 'C:\Users'

it returns True.
However, in Windows Explorer, I see ‘Benutzer’ instead of ‘Users’. When I run the command:

Test-Path 'C:\Benutzer'

it returns False.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

How can I tell PowerShell to recognize localized folder names?

>Solution :

The localized folder names are just for display, they are not an actual path. Thus, C:\Benutzer does not exist as path. Explorer looks up the Desktop.ini file in folders for customization such as localized folder names and special icons.

So you would have to traverse all folders and look up the Desktop.ini file to find out whether the given name was a localized name, and it would still not exist as actual path.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading