From a55697dadc250ba43423f4f25dc6e6bea58d9591 Mon Sep 17 00:00:00 2001 From: blue Date: Sat, 15 Jun 2019 17:31:41 +0100 Subject: [PATCH] Use System.Version for version comparisons --- Get-Bootcamp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Get-Bootcamp.ps1 b/Get-Bootcamp.ps1 index 7ad0883..918d47a 100644 --- a/Get-Bootcamp.ps1 +++ b/Get-Bootcamp.ps1 @@ -18,7 +18,7 @@ if (!(Test-Path $OutputDir)) { New-Item -Path $OutputDir -ItemType Directory -Fo # Check if at least 7zip 15.14 is installed. If not, download and install it. $7z = "$env:ProgramFiles\7-Zip\7z.exe" if (Test-Path $7z) { $7zInstalled = $true } -if ([decimal](Get-ItemProperty $7z).VersionInfo.FileVersion -lt 15.14) { +if ([version](Get-ItemProperty $7z).VersionInfo.FileVersion -lt 15.14) { Invoke-WebRequest -Uri $SEVENZIP_URL -OutFile "$OutputDir\$($SEVENZIP_URL.Split('/')[-1])" -ErrorAction Stop Start-Process -FilePath $env:SystemRoot\System32\msiexec.exe -ArgumentList "/i $OutputDir\$($SEVENZIP_URL.Split('/')[-1]) /qb- /norestart" -Wait -Verbose }