Skip to content
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

Make UseCompatibleCmdlets not throw if default reference desktop-5.1.14393.206-windows is specified in the list of platforms and use core-6.0.2-windows as an alternative default reference #1043

Conversation

bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Jul 24, 2018

PR Summary

The UseCompatibleCmdlets rule works by flagging up cmdlets that are only either present in the default reference (desktop-5.1.14393.206-windows) or in one of the specified references. According to the code comments this is to ensure that aliases or custom functions are not flagged up as incompatible.
However, from a user's point of view, one might add the default reference also to the list of compatible references in the settings file for implicit documentation of what platforms/versions are supported and also because a user does not care how the work is done under the covers.
This PR ensures that no error is being thrown in this case and also adds core-6.0.2-windows as an alternative reference if the user used only desktop-5.1.14393.206-windows in the rule settings.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets. Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • User facing documentation needed
  • Change is not breaking
  • Make sure you've added a new test if existing tests do not effectively test the code changed
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@bergmeister bergmeister added this to the 1.18 milestone Jul 24, 2018
@bergmeister bergmeister changed the title Make UseCompatibleCmdletsnot throw if default reference desktop-5.1.14393.206-windows is specified in the list of platforms Make UseCompatibleCmdletsnot throw if default reference desktop-5.1.14393.206-windows is specified in the list of platforms and use core-6.0.2-windows as an alternative default reference Jul 24, 2018
@bergmeister bergmeister changed the title Make UseCompatibleCmdletsnot throw if default reference desktop-5.1.14393.206-windows is specified in the list of platforms and use core-6.0.2-windows as an alternative default reference Make UseCompatibleCmdlets not throw if default reference desktop-5.1.14393.206-windows is specified in the list of platforms and use core-6.0.2-windows as an alternative default reference Jul 24, 2018
Copy link
Member

@JamesWTruher JamesWTruher left a comment

Choose a reason for hiding this comment

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

my dislike of the test is not a blocker

Tests/Rules/UseCompatibleCmdlets.tests.ps1 Show resolved Hide resolved
@JamesWTruher JamesWTruher merged commit 0272c25 into PowerShell:development Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants