diff --git a/src/Microsoft.PowerShell.Linux.Host/ui.cs b/src/Microsoft.PowerShell.Linux.Host/ui.cs index ba9f71f84..dca2da4b1 100644 --- a/src/Microsoft.PowerShell.Linux.Host/ui.cs +++ b/src/Microsoft.PowerShell.Linux.Host/ui.cs @@ -416,10 +416,27 @@ ReadNext: /// /// Unique identifier of the source of the record. /// A ProgressReport object. - public override void WriteProgress(long sourceId, ProgressRecord record) - { + public override void WriteProgress(long sourceId, ProgressRecord record) + { + + if (record == null) + { + throw PSTraceSource.NewArgumentNullException("record"); + } - } + string percentComplete = " ["; + + for (int i =0; i < record.PercentComplete; i++){ + percentComplete = percentComplete + "0"; + } + + percentComplete = percentComplete + "]"; + Console.Write ("\r{0} {1} {2} ", record.Activity, record.StatusDescription, percentComplete, "\r"); + + if (record.PercentComplete == 100){ + Console.WriteLine(); //create a new line for the prompt + } + } /// /// Writes a verbose message to the output display of the host.