Your environments are not playing the same version of PowerShell, or at least the same version of the the CLR. try to look at $PSVersionTable
.
Environment.SpecialFolder enum contains ProgramFilesX86
in NET Framework 4.5 this was not the case in NET Framework 3.5 and previous versions.