Skip to content

Add tab completion for Export-Counter -FileFormat parameter - #3856

Merged
Travis Plunk (TravisEz13) merged 2 commits into
PowerShell:masterfrom
MiaRomero:export-counter-tab-completion
Jun 25, 2017
Merged

Add tab completion for Export-Counter -FileFormat parameter#3856
Travis Plunk (TravisEz13) merged 2 commits into
PowerShell:masterfrom
MiaRomero:export-counter-tab-completion

Conversation

@MiaRomero

@MiaRomero Maria Romero (MiaRomero) commented May 24, 2017

Copy link
Copy Markdown
Member

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.

This does not appear to be validating the format. Please correct the comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can remove IgnoreCase = true - it is by default.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed.

@MiaRomero
Maria Romero (MiaRomero) force-pushed the export-counter-tab-completion branch from ff1a99f to 094ba3c Compare May 25, 2017 21:15

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.

Since we have tab completion now, should they be spelled out? CommaSeperatedValues, TabSeperatedValues and BinaryLog?

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.

Had a chat with Jim. It is ok to keep them as is. Please open an issue on https://github.com/PowerShell/PowerShell-Docs/blob/staging/reference/5.1/Microsoft.PowerShell.Diagnostics/Export-Counter.md to explain what they mean.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The file types are explained in the 'Description' section of the documentation. Did you want them in the 'Parameter' section as well?

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.

Maria Romero (@MiaRomero) Yes, please add them to the parameters section as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've opened issue MicrosoftDocs/PowerShell-Docs#1245 for this

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.

I think this test is not needed as it does not hit any code in the cmdlet. It hits Parameter Validation code paths.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed test case

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.

This line seems unnecessary.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed line 314

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.

Please update comment, SetOuputFormat does not do any validation anymore.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated comment

@TravisEz13

Travis Plunk (TravisEz13) commented May 26, 2017

Copy link
Copy Markdown
Member

Maria Romero (@MiaRomero) Please make your membership in the Microsoft Organization public. I sent instructions offline.

#Resolved

@TravisEz13 Travis Plunk (TravisEz13) 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.

#resolved

@TravisEz13
Travis Plunk (TravisEz13) dismissed their stale review May 26, 2017 20:54

Please address @adityapatwardhan 's comments

@TravisEz13

Copy link
Copy Markdown
Member

Maria Romero (@MiaRomero) What is the status of this PR?

@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.

please add a test case to TabCompletion.Tests.ps1

@MiaRomero
Maria Romero (MiaRomero) force-pushed the export-counter-tab-completion branch 2 times, most recently from e3587dc to 6633eff Compare June 1, 2017 18:16
@MiaRomero

Copy link
Copy Markdown
Member Author

Hi Travis Plunk (@TravisEz13),
I've addressed Aditya Patwardhan (@adityapatwardhan)'s and Steve Lee (@SteveL-MSFT)'s comments regarding the cmdlet and test code. I added a comment asking for clarification on the documentation. Once I have that I can open the appropriate issue.

@lzybkr Jason Shirk (lzybkr) Jun 1, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We try to avoid Should Be $true because it is difficult to understand what went wrong just reading the logs.

In this specific case, I would instead use:

$res.CompletionMatches.CompletionText -join ' ' | Should Be 'blg csv tsv'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There might be a problem with the element's order.
We can use the auxiliary output

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If order is a concern, pipe to sort first. But in this case, if order is not preserved, I would call that a bug.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Jason Shirk (@lzybkr) , thank you, I've made the change. Is it appropriate to go ahead and fix the other test cases in this file that use the same pattern? Or is that a separate issue/PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you see the pattern in other files, then maybe a new PR, otherwise this PR is fine.

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.

Maria Romero (@MiaRomero) Yes, please add them to the parameters section as well.

@MiaRomero
Maria Romero (MiaRomero) force-pushed the export-counter-tab-completion branch from 6633eff to cfe301f Compare June 2, 2017 17:40
@TravisEz13

Copy link
Copy Markdown
Member

Please investigate test failure

@MiaRomero
Maria Romero (MiaRomero) force-pushed the export-counter-tab-completion branch from cfe301f to 45a5520 Compare June 7, 2017 00:57
@TravisEz13

Copy link
Copy Markdown
Member

I pinged Maria Romero (@MiaRomero) about updating her profile in order to get the PR merged.

@MiaRomero

Copy link
Copy Markdown
Member Author

Travis Plunk (@TravisEz13) thanks for the link, updated my profile.

@TravisEz13 Travis Plunk (TravisEz13) added Blocked blocked on something external to this repo and removed Blocked blocked on something external to this repo labels Jun 25, 2017
@TravisEz13
Travis Plunk (TravisEz13) merged commit 471f4e8 into PowerShell:master Jun 25, 2017
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
…ll#3856)

* add tab completion for -FileFormat parameter

* update expected error for invalid -FileFormat test case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants