Just moved the file check to after we have created the item.
This commit is contained in:
parent
7a3bc96f75
commit
91e24d886b
1 changed files with 6 additions and 6 deletions
12
scripts/obtain/dotnet-install.ps1
vendored
12
scripts/obtain/dotnet-install.ps1
vendored
|
@ -396,12 +396,6 @@ if ($DryRun) {
|
||||||
$InstallRoot = Resolve-Installation-Path $InstallDir
|
$InstallRoot = Resolve-Installation-Path $InstallDir
|
||||||
Say-Verbose "InstallRoot: $InstallRoot"
|
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
|
$IsSdkInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage "sdk" -SpecificVersion $SpecificVersion
|
||||||
Say-Verbose ".NET SDK installed? $IsSdkInstalled"
|
Say-Verbose ".NET SDK installed? $IsSdkInstalled"
|
||||||
if ($IsSdkInstalled) {
|
if ($IsSdkInstalled) {
|
||||||
|
@ -411,6 +405,12 @@ if ($IsSdkInstalled) {
|
||||||
|
|
||||||
New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null
|
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) {
|
foreach ($DownloadLink in $DownloadLinks) {
|
||||||
$ZipPath = [System.IO.Path]::GetTempFileName()
|
$ZipPath = [System.IO.Path]::GetTempFileName()
|
||||||
Say "Downloading $DownloadLink"
|
Say "Downloading $DownloadLink"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue