Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(GH-2051) Fix: workingDirectory always replaced w/cacheLocation
The previous commit 9e2e49a to address UNC paths broke the ability to provide a working directory to the Start-ChocolateyProcessAsAdmin helper function. The test `$workingDirectory.ProviderPath -eq $null` always evaluates to true because the String type does not have the member ProviderPath. The fix is to obtain the location object only when no path is provided to the helper and to verify its validity before use, possibly falling back to the cache location, similar to how it was implemented for Get-ChocolateyUnzip.
- Loading branch information
This should probably be:
if (!$workingDirectory) {