-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Modify the -AsHashTable code to get the base object from the PSObject for the hashtable. #7123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ct when creating a key in the hashtable.
| if (_grp.Values.Count == 1) | ||
| { | ||
| _table.Add(_grp.Values[0], _grp.Group); | ||
| _table.Add(PSObject.Base(_grp.Values[0]), _grp.Group); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest leaving a comment here since the change is rather subtle; otherwise, the change looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the comment would be useful.
| $result['Failed'].ErrorMessage.Count | Should -Be 5 | ||
| $result['Failed'].ErrorMessage[0] | Should -Be 'SomeError' | ||
| $result['Successful'].ErrorMessage.Count | Should -Be 4 | ||
| $result['Successful'].ErrorMessage[0] | Should -Be '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use more readable value instead of ''?
PaulHigin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@BrucePay Thanks for this! I've wanted to use it several times but always ended up being frustrated. |
PR Summary
Fix #6933.
Modified the
Group-Object -AsHashTablecode to get the base object from the PSObject before using the value to create a key in the hashtable.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests