support/install_command.ps1 in mixlib-install-0.7.1 vs support/install_command.ps1 in mixlib-install-0.8.0.alpha.0
- old
+ new
@@ -1,16 +1,16 @@
Function Check-UpdateChef($root, $version) {
if (-Not (Test-Path $root)) { return $true }
elseif ("$version" -eq "true") { return $false }
elseif ("$version" -eq "latest") { return $true }
- Try { $chef_version = (Get-Content $root\version-manifest.txt | select-object -first 1) }
+ Try { $chef_version = Get-Content $root\version-manifest.txt | select-object -1}
Catch {
- Try { $chef_version = (& $root\bin\chef-solo.bat -v) }
- Catch { $chef_version = " " }
+ Try { $chef_version = (& $root\bin\chef-solo.bat -v).split(" ", 2)[1] }
+ Catch { $chef_version = "" }
}
- if ($chef_version.split(" ", 2)[1].StartsWith($version)) { return $false }
+ if ($chef_version.StartsWith($version)) { return $false }
else { return $true }
}
Function Get-ChefMetadata($url) {
Try { $response = ($c = Make-WebClient).DownloadString($url) }