From 16d769ea63b14d2c229d523334e3deb11c807a57 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sat, 2 Jan 2016 12:55:53 -0600 Subject: [PATCH] (GH-525) Improve write-progress The write-progress doesn't always write the 100% line out, so have Get-WebFile state that it has finished downloading the file. --- src/chocolatey.resources/helpers/functions/Get-WebFile.ps1 | 4 +++- .../infrastructure/powershell/PoshHostUserInterface.cs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/chocolatey.resources/helpers/functions/Get-WebFile.ps1 b/src/chocolatey.resources/helpers/functions/Get-WebFile.ps1 index 142edd6009..e3c64e025b 100644 --- a/src/chocolatey.resources/helpers/functions/Get-WebFile.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-WebFile.ps1 @@ -162,10 +162,12 @@ param( } if ($total -eq $goal) { - Write-Progress "Completed download of $url." "Completed a total of $total bytes of $fileName" -id 0 -Completed + Write-Progress "Completed download of $url." "Completed download of $fileName ($goalFormatted)." -id 0 -Completed } } } while ($count -gt 0) + Write-Host "" + Write-Host "Download of $([System.IO.Path]::GetFileName($fileName)) ($goalFormatted) completed." } catch { throw $_.Exception } finally { diff --git a/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs b/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs index 40d0f548bd..6e6ee21814 100644 --- a/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs +++ b/src/chocolatey/infrastructure/powershell/PoshHostUserInterface.cs @@ -136,8 +136,8 @@ public override void WriteProgress(long sourceId, ProgressRecord record) if (record.PercentComplete == 100 && !hasLoggedFinalProgress) { hasLoggedFinalProgress = true; - this.Log().Info(""); - this.Log().Info(record.StatusDescription.Replace("Saving","Finished downloading. Saved")); + //this.Log().Info(""); + //this.Log().Info(record.StatusDescription.Replace("Saving","Finished downloading. Saved")); } }