Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[Enhancement] Don't assume that $env:USERPROFILE and $env:TEMP are predefined #647
The install.ps1 at chocolatey.org assumes that it can safely create a temporary temp folder using Join-Path and $env:TEMP. However, that environment variable may be unset and the directory may not exist until the current user has logged into the system. (Packer uses a VM with a bash shell and the current working user when chocolatey install.ps1 is executed has yet to perform a Windows login.)
Better: either test for the existence of any chosen base directory (e.g. C:\Windows\temp) or simply create one at the root of the filesystem and delete it when finished.