Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@
<value>Unable to retrieve certificates because the thumbprint is not valid. Verify the thumbprint and retry. </value>
</data>
<data name="WriteRequestComplete" xml:space="preserve">
<value>Writing web request completed. (Number of bytes remaining: {0})</value>
<value>Web request completed. (Number of bytes processed: {0})</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the original "remaining" correct? Meaning that it should be "Number of bytes to process"?

Copy link
Contributor Author

@markekraus markekraus Oct 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was wrong all along. This string is the message that is sent last when the stream has completed.

if (cmdlet != null)
{
ProgressRecord record = new ProgressRecord(ActivityId,
WebCmdletStrings.WriteRequestProgressActivity,
StringUtil.Format(WebCmdletStrings.WriteRequestComplete, totalWritten));
record.RecordType = ProgressRecordType.Completed;
cmdlet.WriteProgress(record);
}

in 5.1:

$Job = Start-Job -ScriptBlock { 
    Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -outfile $env:temp\nuget.exe 
} | Wait-Job
$progress = $Job.ChildJobs[0].Progress.ReadAll()
$progress[-2].StatusDescription
$progress[-1].StatusDescription

result:

Writing request stream... (Number of bytes written: 5010552)
Writing web request completed. (Number of bytes remaining: 5010552)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, your change looks good then. Thanks!

</data>
<data name="WriteRequestProgressActivity" xml:space="preserve">
<value>Writing web request</value>
<value>Web request status</value>
</data>
<data name="WriteRequestProgressStatus" xml:space="preserve">
<value>Writing request stream... (Number of bytes written: {0})</value>
<value>Number of bytes processed: {0}</value>
</data>
<data name="JsonNetModuleRequired" xml:space="preserve">
<value>The ConvertTo-Json and ConvertFrom-Json cmdlets require the 'Json.Net' module. {0}</value>
Expand Down