diff --git a/lib/vagrant-omnibus/action/install_chef.rb b/lib/vagrant-omnibus/action/install_chef.rb index 5a32611..02f363d 100644 --- a/lib/vagrant-omnibus/action/install_chef.rb +++ b/lib/vagrant-omnibus/action/install_chef.rb @@ -214,7 +214,7 @@ def fetch_or_create_install_script(env) set version=%1 set dest=%~dp0chef-client-%version%-1.windows.msi echo Downloading Chef %version% for Windows... - powershell -command "(New-Object System.Net.WebClient).DownloadFile('#{url}?v=%version%', '%dest%')" + powershell -command "if(test-path '#{url}/chef-client*%version%*.msi'){[array]$tempstore = dir #{url} | ?{$_.name -like 'chef-client*%version%*.msi'};copy $tempstore[0].fullname %dest%}else{(New-Object System.Net.WebClient).DownloadFile('#{url}?v=%version%', '%dest%')}" echo Installing Chef %version% msiexec /q /i %dest% EOH