misheska/basebox-packer — pull request #50 by rasa (2014-03-27 18:25:30+00:00)
Title: Fixes #35: Use of Powershell in preinstall scripts stymies slipstreaming

Skip all .bat/.cmd scripts that start with an underscore (floppy/00-run-all-scripts.cmd)
Added debug variables PACKER_DEBUG and PACKER_PAUSE (floppy/00-run-all-scripts.cmd)
Moved A:\ to end of the PATH, to give precendence to installed applications (floppy/00-run-all-scripts.cmd)
Search for tee.exe in the PATH first, before looking in A:\ (floppy/00-run-all-scripts.cmd)
Removed extra " char in junction command (floppy/openssh.bat)
Replace IF with GOTO to avoid delayed expansion issues, and to easily add future provisioners (script/provisioner.bat)
Replace all ! with % as appropriate
Use wget or bitsadmin, if found in the PATH, or on A:\, otherwise use powershell
Skip downloading any file if it's found on a:\, d:\ or in the PATH
This addresses the following issues after slipstreaming Windows updates into installation media:
After installing all Windows and .Net 3.51 updates, running powershell during installation would produce:
"Version v4.0.30319 of the .NET Framework is not installed and it is required to run version 3 of Windows PowerShell."
After installing all Windows and .Net 3.51 updates, and then .NET 4.51 (NDP451-KB2858728-x86-x64-AllOS-ENU.exe),
running powershell during installation would produce:
"Internal Windows PowerShell error. Loading managed Windows PowerShell failed with error 80070002."

Testing and working in VMWare 10 on all builds but:

* win2012-standard-cygwin (ssh doesn't start)
* win2012r2-standard-cygwin (ssh doesn't start)
* win2008r2-enterprise-cygwin (black screen after BIOS, probably vmware10 issue)
* win2008r2-enterprise (black screen after BIOS, probably vmware10 issue)
* win2008r2-standard-cygwin (black screen after BIOS, probably vmware10 issue)
* win2008r2-standard (black screen after BIOS, probably vmware10 issue)
* win2008r2-web-cygwin (black screen after BIOS, probably vmware10 issue)
* win2008r2-web (black screen after BIOS, probably vmware10 issue)