chocolatey/chocolatey — pull request #564 by mwrock (2014-09-02 09:38:59+00:00)
Title: add label to new file types in the Install-ChocolateyFileAssociation command and enhancements to Start-ChocolateyProcessAsAdmin

This includes a fix to the Install-ChocolateyFileAssociation command to prevent the windows explorer New Item context menu from having items removed when this command replaces file extensions with new types.

More significantly this makes Start-ChocolateyProcessAsAdmin easier to work with by:
1. Encoding the command string to reduce the coding friction around nested quotes and multi line powershell blocks. As can be seen from Install-ChocolateyFileAssociation, I can now construct my elevated script using an easier to read and write here string.

2. Do a better job of capturing errors from the elevated script and bubbling them back up to the package error. While testing with the Install-ChocolateyFileAssociation command, My script raised an error that I would see appear and then disappear. The final error and what was in the log simply tells me there is an error. This dumps the standard error stream of the elevated process to a file. If the process was a powershell process the stream is output as CLIXML and this will deserialize that to its human readable form.

3. This removes duplicate errors. I still noticed a duplicate error after these changes but there were far fewer than before.

I realize this change is fairly significant and if others dont see the value add here, I'm happy to resubmit with just the File Association specific changes.