Repository navigation
Only display properties with values for MeasureInfo - #7104
Ilya (iSazonov) merged 10 commits into
Conversation
|
From #6412 #6214 (comment)
|
|
The build errors seems completely separate from my changes. |
|
Reopen the PR to restart CIs. |
|
I don't intend to fix the remaining CodeFactor issues. |
|
James Truher (@JamesWTruher) can you please take a look? Thx. |
|
Jim is on a leave; + Steve Lee (@SteveL-MSFT) for review who is familiar with formatting APIs. |
| } | ||
|
|
||
| private ListEntryBuilder AddItem(string value, string label, DisplayEntryValueType kind, string format) | ||
| private ListEntryBuilder AddItem(string value, string label, DisplayEntryValueType kind, string format, DisplayEntry itemSelectionContition) |
There was a problem hiding this comment.
typo: itemSelectionCondition
|
|
||
| /// <summary></summary> | ||
| public ListEntryBuilder AddItemScriptBlock(string scriptBlock, string label = null, string format = null) | ||
| public ListEntryBuilder AddItemScriptBlock(string scriptBlock, string label = null, string format = null, DisplayEntry itemSelectionContition = null) |
There was a problem hiding this comment.
typo: itemSelectionCondition
|
|
||
| /// <summary></summary> | ||
| public ListEntryBuilder AddItemProperty(string property, string label = null, string format = null) | ||
| public ListEntryBuilder AddItemProperty(string property, string label = null, string format = null, DisplayEntry itemSelectionContition = null) |
There was a problem hiding this comment.
typo: itemSelectionCondition
| /// <summary></summary> | ||
| public ListEntryBuilder AddItemPropertyIfSet(string property, string label = null, string format = null) | ||
| { | ||
| var itemSelectionContition = DisplayEntry.CreatePropertyEntry(property); |
There was a problem hiding this comment.
typo: itemSelectionCondition
| $text = 1, 2, 3 | Measure-Object -Minimum -Maximum | Format-List | Out-String | ||
| $text -match "min" | Should -BeTrue | ||
| $text -match "max" | Should -BeTrue | ||
| $text -match 'Average' | Should -BeFalse |
There was a problem hiding this comment.
Seems we skipped
$text -match 'Sum' | Should -BeFalseThere was a problem hiding this comment.
Staffan Gustafsson (@powercode) Please address the comment.
|
Bruce Payette (@BrucePay) Jason Shirk (@lzybkr) Please look the PR. |
1b4a460 to
b424329
Compare
|
Staffan Gustafsson (@powercode) Thank you for the contribution! I added "Documentation-Needed" label (if you can please open new issue in PowerShell-Docs repo). |
| /// <returns>A <see cref="DisplayEntry"/> for the <paramref name="scriptblock"/>.</returns> | ||
| public static DisplayEntry CreateScriptBlockEntry(string scriptblock) | ||
| { | ||
| return new DisplayEntry(scriptblock, DisplayEntryValueType.ScriptBlock); |
There was a problem hiding this comment.
Paul Higinbotham (@PaulHigin) should review this new public api for any security implications in creating script blocks that might circumvent the language mode.
There was a problem hiding this comment.
Paul Higinbotham (@PaulHigin) reviewed this and told me he doesn't see a security issue. Paul Higinbotham (@PaulHigin) can you confirm?
|
Ilya (@iSazonov) we should revert this commit until security review of the public api has been completed |
|
Steve Lee (@SteveL-MSFT) Opened #7754. |
…ll#7104)" (PowerShell#7754) This reverts commit 87ccd0a until security review of the public api has been completed.
* Adding support for built-in List formats to include ItemSelectionCondition * Adding ItemSelectionCondition to GenericMeasureInfo * Adding tests for MeasureInfo format-list * Adding positive tests
…ll#7104)" (PowerShell#7754) This reverts commit f657820 until security review of the public api has been completed.
PR Summary
Adding Item selection conditions to the list formatting info for MeasureInfo so that only the properties with values gets displayed
Reopening #6214
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 testsThis change is