8000 Add comment describing why -ia is not the alias for -InformationAction common parameter by KirkMunro · Pull Request #10703 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@KirkMunro
Copy link
Contributor
@KirkMunro KirkMunro commented Oct 4, 2019

PR Summary

This adds a comment highlighting why a common parameter alias name breaks the naming convention used for other common parameters.

PR Context

This comment is being added so that others looking at this code in the future will know why the alias naming convention is different in this case.

PR Checklist

@daxian-dbw
Copy link
Member

There is a possibility of breaking existing scripts with parameters that has ia alias or starts with ia.
Maybe no one knows anymore, but I wonder maybe infa was intentionally chosen at the time to avoid a breaking change.

@daxian-dbw daxian-dbw added the Breaking-Change breaking change that may affect users label Oct 4, 2019
@KirkMunro
Copy link
Contributor Author
KirkMunro commented Oct 4, 2019

@daxian-dbw I thought about that, and did a search across all commands I have (native + installed modules like Azure, AWS, etc.) and across 9870 cmdlets there aren't any parameters that have ia as an alias, nor are there any with parameters that start with ia. I think it might just be something that was missed, because we don't Pester test parameter aliases.

Also, if what you suggest is tru 8000 e, why would iv have been chosen at the exact same time as an alias for the -InformationVariable common parameter?

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 7, 2019
@iSazonov iSazonov added this to the 7.0.0-preview.5 milestone Oct 7, 2019
@daxian-dbw daxian-dbw added the Review - Committee The PR/Issue needs a review from the PowerShell Committee label Oct 8, 2019
@daxian-dbw
Copy link
Member

@PowerShell/powershell-committee Please review the proposed new alias -ia for the common parameter -InformationAction.
There is a possibility of breaking existing scripts with parameters that has ia alias or starts with ia, but also it might fall into the bucket 3 breaking change.

@SteveL-MSFT
Copy link
Member

@PowerShell/powershell-committee reviewed this, since an explicit alias was chosen when Information Stream feature was added we investigated if there is a conflict with existing use of ia as a parameter alias. We found one instance with Find-UpgradeableChocolateyPackage that has ia as alias for -InstallArgs. For this reason, we don't accept the proposal for ia alias for InformationAction.

@SteveL-MSFT SteveL-MSFT added Committee-Rev 8000 iewed PS-Committee has reviewed this and made a decision and removed Review - Committee The PR/Issue needs a review from the PowerShell Committee labels Oct 9, 2019
@SteveL-MSFT
Copy link
Member

Thanks to @LeeHolmes who dug through ancient history, originally this parameter did have the ia alias, but it caused a breaking change as the inbox cmdlet New-IscsiTargetPortal was already using that alias. So it was changed to infa.

@KirkMunro
Copy link
Contributor Author

@SteveL-MSFT Thanks to both of you.

Not that this comes up often, but it would be worth having a comment in the code that points this out, no? I can always change this PR to just add that, or close this and submit another PR.

@SteveL-MSFT
Copy link
Member

@KirkMunro please update the PR to add a comment on why it's not ia so we don't have to dig through history again in the future :)

@KirkMunro
Copy link
Contributor Author

Done.

Aside: If tab completion used some fuzzy logic to match alias names, I think most parameter aliases wouldn't be necessary.

@KirkMunro KirkMunro changed the title Add -ia alias for -InformationAction common parameter Add comment describing why -ia is not the alias for -InformationAction common parameter Oct 10, 2019
@SteveL-MSFT
Copy link
Member

@PoshChan please retry macos

@PoshChan
Copy link
Collaborator

@SteveL-MSFT, successfully started retry of PowerShell-CI-macOS

@daxian-dbw daxian-dbw removed the Breaking-Change breaking change that may affect users label Oct 10, 2019
@anmenaga anmenaga added CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log and removed CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log labels Oct 10, 2019
@ghost
Copy link
ghost commented Oct 23, 2019

🎉v7.0.0-preview.5 has been released which incorporates this pull request.:tada:

Handy links:

@KirkMunro KirkMunro deleted the add-ia-alias-for-informationaction branch November 4, 2019 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log Committee-Reviewed PS-Committee has reviewed this and made a decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

0