Is there a way to use either KNOWNFOLDERID or CSIDL in PowerShell?
I need to be able to access some "known folders" via PowerShell script on a variety of systems. The problem is that those folders' names tend to differ between languages and Environmental Variables list (e.g. $env:something) does not contain folders I am interested accessing in (e.g. C:\Users).
Use the .NET method System.Environment.GetFolderPath like so:
The MSDN topic on the Environment.SpecialFolder enum shows all the possible special folders you can ask for.