Skip to content

Fixing progress for Get-ComputerInfo - #9236

Merged
Aditya Patwardhan (adityapatwardhan) merged 2 commits into
PowerShell:masterfrom
powercode:ComputerInfo
Apr 4, 2019
Merged

Aditya Patwardhan (adityapatwardhan) merged 2 commits into
PowerShell:masterfrom
powercode:ComputerInfo

Conversation

@powercode

@powercode Staffan Gustafsson (powercode) commented Mar 27, 2019 •

Copy link
Copy Markdown
Collaborator

PR Summary

The function that handled progress for Get-ComputerInfo always set the RecordType to Completed.

PR Context

Progress for the cmdlet seemed to disappear.

PR Checklist

@PoshChan-Staging

This comment has been minimized.

@powercode
Staffan Gustafsson (powercode) force-pushed the ComputerInfo branch 2 times, most recently from 858b021 to c033494 Compare March 27, 2019 14:03

@SteveL-MSFT Steve Lee (SteveL-MSFT) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor style nit

@SteveL-MSFT

Copy link
Copy Markdown
Member

Staffan Gustafsson (@powercode) I believe you're the first person to get to experience PoshChan-Bot (@PoshChan)'s new capability. I'm curious of your thoughts if it was helpful and if you have any suggestions to improve it.

@powercode

Staffan Gustafsson (powercode) commented Mar 28, 2019 •

Copy link
Copy Markdown
Collaborator Author

Steve Lee (@SteveL-MSFT) I loved the easy access to the test failures! Didn't think much about what should be improved as I just saw it as a huge improvement!

I was very pleasantly surprised!

@adityapatwardhan

Aditya Patwardhan (adityapatwardhan) commented Mar 29, 2019 •

Copy link
Copy Markdown
Member

Staffan Gustafsson (@powercode) I was wondering whether a test like the following should be added:

Describe "Testing Get-Help Progress" -Tags @('Feature') {
It "Last ProgressRecord should be Completed" {
try {
$j = Start-Job { Get-Help DoesNotExist }
$j | Wait-Job
$j.ChildJobs[0].Progress[-1].RecordType | Should -Be ([System.Management.Automation.ProgressRecordType]::Completed)
}
finally {
$j | Remove-Job
}
}
}

@powercode

Copy link
Copy Markdown
Collaborator Author

Aditya Patwardhan (@adityapatwardhan) You're welcome to push it!

@adityapatwardhan

Copy link
Copy Markdown
Member

Staffan Gustafsson (@powercode) Found a bug while adding test. The value of status was updated before the null check, hence we never set the recordtype as completed. Fixed the bug and added the test. Please have a look.

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit 4ec36a0 into PowerShell:master Apr 4, 2019
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Apr 4, 2019
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants