OneGet / MicrosoftDockerProvider

Provider to search, save and install Docker
Other
135 stars 56 forks source link

fix '$env:TEMP' path resolving issue #53

Open GreatTeacherBasshead opened 5 years ago

GreatTeacherBasshead commented 5 years ago

$env:TEMP can be resolved to DOS-style path like 'C:\Users\ARZZ~1.BOK\AppData\Local\Temp', and then after Join-Path the resulting literal path is invalid. If you Test-Path $script:location_modules, you get false in this case. It causes that remove-item in line 334 fails the installation.

cwilhit commented 5 years ago

I am unable to repro this. I tested by joining a DOS-style path with another path, and Test-Path is able to correctly detect whether the path exists or not.

GreatTeacherBasshead commented 5 years ago

Ok... My bad. Test-Path works, but Remove-Item does not: docker_module_error

cwilhit commented 5 years ago

What version of Windows and PowerShell are you using? I can't get this to repro (follwed the instructions above).

GreatTeacherBasshead commented 5 years ago

I have it both on Windows Server 2016 and 2019. Windows PowerShell 5.1

I think the problem is in the user name. Try to test it for a user, who has a dot in the name, like I showed.

shoddyguard commented 4 years ago

FYI I'm experiencing the $env:TEMP bug as noted in #71 I believe @GreatTeacherBasshead is correct as my user account also has a . in it.