chocolatey/chocolatey — pull request #476 by jberezanski (2014-05-21 23:18:11+00:00)
Title: Fixed Get-ChocolateyUnzip when running as SYSTEM (and some other improvements)

````Get-ChocolateyUnzip```` would silently fail when running as SYSTEM on a 64-bit OS.
This happened when using Chocolatey to configure an Azure virtual machine (using the custom script extension).

The SYSTEM profile uses ````$Env:SystemRoot\System32\config\systemprofile\AppData\Local\Temp```` as the TEMP path. When 7za.exe, a 32-bit program running under the WOW64 layer on a 64-bit OS, is passed such path, its I/O operations are transparently redirected to ````$Env:SystemRoot\SysWOW64\...````

The fix is quite simple: on a 64-bit OS, use ````sysnative```` instead of ````System32```` in paths passed to 7za.exe. [1]

It was much more work to provide tests for that, however. To achieve testability I had to:
- add a basic suite of tests for Get-ChocolateyUnzip
- fix test setup code to always refresh the helper functions (remove the module) - otherwise repeated test invocations would not pick up my code changes
- implement GH-455 (made Get-ChocolateyUnzip detect and report failures)

While I was dabbling at Get-ChocolateyUnzip, I also improved the docs a bit to more accurately reflect the capabilities of that helper.

[1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa384187.aspx