puppetlabs/facter — pull request #800 by joshcooper (2014-10-09 17:40:56+00:00)
Title: (FACT-710) Prefer 64-bit powershell

Previously, facter would execute 'powershell.exe' for external powershell
based facts. However, when running in 32-bit ruby, this executes 32-bit
powershell, which behaves very differently than 64-bit powershell due to
them having different PSModulePaths. As a result, there are many times where
a user could execute the powershell script from the command line, but the
same script would fail when executed by facter.

This commit changes the powershell parser to prefer the 64-bit powershell
using the sysnative alias. If that doesn't exist, we fall back to the system32
directory (in case powershell is not in the PATH), and finally fall back to
an unqualified 'powershell.exe'. This follows the convention adopted in the
powershell module[1]

[1] https://github.com/puppetlabs/puppetlabs-powershell/blob/1.0.3/lib/puppet/provider/exec/powershell.rb#L6-L13