From 91e24d886b04bbb9379c93d625517e0221480dd1 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Tue, 15 Nov 2016 12:19:12 -0800 Subject: [PATCH] Just moved the file check to after we have created the item. --- scripts/obtain/dotnet-install.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/obtain/dotnet-install.ps1 b/scripts/obtain/dotnet-install.ps1 index 0168ad8e1..30f316467 100644 --- a/scripts/obtain/dotnet-install.ps1 +++ b/scripts/obtain/dotnet-install.ps1 @@ -396,12 +396,6 @@ if ($DryRun) { $InstallRoot = Resolve-Installation-Path $InstallDir Say-Verbose "InstallRoot: $InstallRoot" -$free = Get-CimInstance -Class win32_logicaldisk | where Deviceid -eq "$((Get-Item $InstallRoot).PSDrive.Name):" -if ($free.Freespace / 1MB -le 250 ) { - Say "there is not enough disk space on drive c:" - exit 0 -} - $IsSdkInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage "sdk" -SpecificVersion $SpecificVersion Say-Verbose ".NET SDK installed? $IsSdkInstalled" if ($IsSdkInstalled) { @@ -411,6 +405,12 @@ if ($IsSdkInstalled) { New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null +$free = Get-CimInstance -Class win32_logicaldisk | where Deviceid -eq "$((Get-Item $InstallRoot).PSDrive.Name):" +if ($free.Freespace / 1MB -le 250 ) { + Say "there is not enough disk space on drive c:" + exit 0 +} + foreach ($DownloadLink in $DownloadLinks) { $ZipPath = [System.IO.Path]::GetTempFileName() Say "Downloading $DownloadLink"