GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix ConvertTo-Html single matched column header bug by TimCurwick · Pull Request #2184 · PowerShell/PowerShell

Conversation

@TimCurwick

@TimCurwick Tim Curwick (TimCurwick) commented Sep 4, 2016

Copy link
Copy Markdown
Contributor

Fix ConvertTo-Html single matched column header bug
Add ConvertTo-Html pester tests for single matched column header bug

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@TimCurwick
Fix ConvertTo-Html single matched column header bug
2b3f793
Fix ConvertTo-Html single matched column header bug
Add ConvertTo-Html pester tests for single matched column header bug
@msftclas

Microsoft Contribution License Agreements (msftclas) commented Sep 4, 2016

Copy link
Copy Markdown

Hi Tim Curwick (@TimCurwick), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@msftclas Microsoft Contribution License Agreements (msftclas) added the cla-already-signed label Sep 4, 2016
@TimCurwick
Update convert-HTML.cs
3ff33ec
@TimCurwick

Tim Curwick (TimCurwick) commented Sep 4, 2016 •
edited by adityapatwardhan
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Fixes issue #2185
There were no tests for ConvertTo-Html. I added a test file with two tests specific to the modified behavior. I presume Microsoft has other, existing tests for ConvertTo-Html that can and should also be run before merging.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TravisEz13 Travis Plunk (TravisEz13) added the Review - Needed label Sep 5, 2016
megamorf
megamorf reviewed Sep 5, 2016
View reviewed changes
Comment thread src/Microsoft.PowerShell.Commands.Utility/commands/utility/convert-HTML.cs Outdated

[Cmdlet(VerbsData.ConvertTo, "Html", DefaultParameterSetName = "Page",
HelpUri = "https://go.microsoft.com/fwlink/?LinkID=113290", RemotingCapability = RemotingCapability.None)]
HelpUri = "http://go.microsoft.com/fwlink/?LinkID=113290", RemotingCapability = RemotingCapability.None)]

@megamorf Sebastian N. (megamorf) Sep 5, 2016

Copy link
Copy Markdown
Contributor

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.

Could you revert this to https please. TLS connections should be the default for URLs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mirichmo Mike Richmond (mirichmo) assigned Aditya Patwardhan (adityapatwardhan) Sep 8, 2016
@mirichmo

Mike Richmond (mirichmo) commented Sep 8, 2016

Copy link
Copy Markdown
Member

Aditya Patwardhan (@adityapatwardhan) Please take a look. This fix is specific to Windows PowerShell (full CLR) because the cmdlet has not yet been ported to CoreCLR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adityapatwardhan
adityapatwardhan reviewed Sep 9, 2016
View reviewed changes
Comment thread test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1 Outdated
$customPSObject = [pscustomobject]@{ "prop1" = "val1"; "prop2" = "val2" }

It "Test ConvertTo-Html header with default single property" -Skip:( $IsLinux -or $IsOSX -or $IsCoreCLR ) {
$returnObject = $customPSObject | Select prop1 | ConvertTo-Html

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) Sep 9, 2016

Copy link
Copy Markdown
Member

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.

Select [](start = 42, length = 6)

Do not use aliases in tests. Use select-object instead.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mirichmo Mike Richmond (mirichmo) added Review - Waiting on Author and removed Review - Needed labels Sep 12, 2016
@TravisEz13 Travis Plunk (TravisEz13) added Review - Needed and removed Review - Waiting on Author labels Sep 12, 2016
@mirichmo Mike Richmond (mirichmo) added Review - Waiting on Author and removed Review - Needed labels Sep 13, 2016
@TravisEz13 Travis Plunk (TravisEz13) added Review - Needed and removed Review - Waiting on Author labels Sep 13, 2016
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) added Review - Waiting on Author and removed Review - Needed labels Sep 14, 2016
@TravisEz13 Travis Plunk (TravisEz13) added Review - Needed and removed Review - Waiting on Author labels Sep 15, 2016
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) added Review - Waiting on Author and removed Review - Needed labels Sep 20, 2016
@adityapatwardhan

Aditya Patwardhan (adityapatwardhan) commented Sep 21, 2016

Copy link
Copy Markdown
Member

Tim Curwick (@TimCurwick) please fix the two small comments in the tests. Rest looks good.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@daxian-dbw

Dongbo Wang (daxian-dbw) commented Oct 13, 2016

Copy link
Copy Markdown
Member

Tim Curwick (@TimCurwick) could you please address the 2 comments and rebase your commits? ConvertTo-Html has been enabled in powershell core.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PowerShellTeam PowerShellTeam added Review - Needed and removed Review - Waiting on Author labels Nov 10, 2016
@TravisEz13 Travis Plunk (TravisEz13) added the Review - Abandoned label Nov 10, 2016
@PowerShellTeam PowerShellTeam added the Review - Needed label Nov 10, 2016
@TravisEz13 Travis Plunk (TravisEz13) added Review - Abandoned and removed Review - Needed labels Nov 10, 2016
@PowerShellTeam PowerShellTeam added the Review - Abandoned label Nov 10, 2016
@TimCurwick
Replaced aliases in ConvertTo-HTML.tests.ps1
8aa1772
@TimCurwick

Tim Curwick (TimCurwick) commented Nov 11, 2016

Copy link
Copy Markdown
Contributor Author

Sorry about the delay. I was on vacation and then busy with the Summit. Airports are great for catching up on work. :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adityapatwardhan

Aditya Patwardhan (adityapatwardhan) commented Nov 11, 2016

Copy link
Copy Markdown
Member

Tim Curwick (@TimCurwick) Seems that there are merge conflicts in test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1. Could you resolve those please?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimCurwick
Resolved conflicts
6b1ecd4
@adityapatwardhan

Aditya Patwardhan (adityapatwardhan) commented Nov 11, 2016

Copy link
Copy Markdown
Member

Tim Curwick (@TimCurwick) Commit# 6b1ecd4 also has merge conflicts.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TravisEz13 Travis Plunk (TravisEz13) added cla-already-signed and removed Review - Abandoned labels Nov 12, 2016
@PowerShellTeam PowerShellTeam added Stale and removed Review - Waiting on Author labels Nov 25, 2016
@chunqingchen

Chunqing Chen (chunqingchen) commented Jan 11, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

please resolve the build conflict. It's still there

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PowerShellTeam PowerShellTeam added the Review - Needed The PR is being reviewed label Jan 11, 2017
@TravisEz13 Travis Plunk (TravisEz13) removed the Stale label Feb 16, 2017
@mirichmo Mike Richmond (mirichmo) assigned Mike Richmond (mirichmo) and unassigned Aditya Patwardhan (adityapatwardhan) Mar 30, 2017
@mirichmo

Mike Richmond (mirichmo) commented Mar 30, 2017

Copy link
Copy Markdown
Member

I am trying to clean out old PRs and this one looks potentially useful.

James Truher (@JamesWTruher) or Dan Travison (@dantraMSFT) - Can one or both of you review this change and provide feedback? Also, please confirm that it is still relevant and has not already been fixed.

If you guys approve of it, I'll guide it in for a landing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mirichmo
Mike Richmond (mirichmo) requested review from James Truher (JamesWTruher) and Dan Travison (dantraMSFT) March 30, 2017 01:16
JamesWTruher
James Truher (JamesWTruher) reviewed May 18, 2017
View reviewed changes
Comment thread test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1

function normalizeLineEnds([string]$text)
{
$text -replace "`r`n?|`n", "`r`n"

@JamesWTruher James Truher (JamesWTruher) May 18, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

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.

$text -replace "${newLine}?|`n","${newLine}"

might be better, or could the line endings be removed entirely? Is that part of what you're looking to validate?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
JamesWTruher
James Truher (JamesWTruher) reviewed May 18, 2017
View reviewed changes
Comment thread test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1
<title>HTML TABLE</title>
</head><body>
<table>
<colgroup><col/><col/><col/></colgroup>

@JamesWTruher James Truher (JamesWTruher) May 18, 2017

Copy link
Copy Markdown
Collaborator

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 sure wish we could replicate less code - create variables and reuse them?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
JamesWTruher
James Truher (JamesWTruher) reviewed May 18, 2017
View reviewed changes
Comment thread test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1

It "Test ConvertTo-Html with no parameters" {
$returnObject = $customObject | ConvertTo-Html
$returnObject -is [System.Array] | Should Be $true

@JamesWTruher James Truher (JamesWTruher) May 18, 2017

Copy link
Copy Markdown
Collaborator

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.

this test isn't really needed, right? isn't the test on line 30 enough?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dantraMSFT Dan Travison (dantraMSFT) May 18, 2017

Copy link
Copy Markdown
Contributor

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 think the test is appropriate; however, it would be easier to diagnose if Type.FullName is compared instead of a soft-cast.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@lzybkr Jason Shirk (lzybkr) May 18, 2017

Copy link
Copy Markdown
Contributor

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.

Should Be $true is an anti-pattern - the logs aren't very useful so try to avoid that.

In this case, you can use 'Should BeOfType`. See the list of Pester assertions here.

And I'll be honest - I'm surprised it's an array - I would have expected a single string, so from that point of view, it might be worth a test to at least make it obvious if someone were to implement my expected behavior.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mi-hol

mi-hol commented Jun 27, 2017

Copy link
Copy Markdown

Tim Curwick (@TimCurwick) are you planning to implemented the requested changes?
James Truher (@JamesWTruher) should the label 'Review - needed' be replaced with another one?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mirichmo Mike Richmond (mirichmo) mentioned this pull request Jul 17, 2017
Fix ConvertTo-Html single matched column header bug #4276
Merged
@mirichmo

Mike Richmond (mirichmo) commented Jul 18, 2017

Copy link
Copy Markdown
Member

I replaced this PR with PR #4276

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mirichmo Mike Richmond (mirichmo) closed this Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dantraMSFT Dan Travison (dantraMSFT) Awaiting requested review from dantraMSFT
2 more reviewers
@lzybkr Jason Shirk (lzybkr) lzybkr left review comments
@JamesWTruher James Truher (JamesWTruher) JamesWTruher left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mirichmo Mike Richmond (mirichmo)

Labels

Review - Needed The PR is being reviewed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

13 participants

@TimCurwick @msftclas @mirichmo @adityapatwardhan @daxian-dbw @chunqingchen @mi-hol @megamorf @lzybkr @JamesWTruher @dantraMSFT @PowerShellTeam @TravisEz13
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.