Skip to content

[Account] Use IArgumentCompleter to implement the Environment parameter auto completer. #16474

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

Merged
merged 3 commits into from
Jan 20, 2022

Conversation

LucasYao93
Copy link
Contributor

@LucasYao93 LucasYao93 commented Nov 23, 2021

Description

Changed ScriptBlock to use IArgumentCompleter to implement The Environment parameter auto completer.

#15991

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
      • {Please put the link here}
    • the markdown help files have been regenerated using the commands listed here

@LucasYao93 LucasYao93 changed the title [Account] Implementations CompleteArgument function in EnvironmentCompleterAttribute. [Account] Environment auto completer to cmdlets of Az.Accounts. Nov 23, 2021
@LucasYao93 LucasYao93 linked an issue Nov 23, 2021 that may be closed by this pull request
@LucasYao93 LucasYao93 changed the title [Account] Environment auto completer to cmdlets of Az.Accounts. [Account] IArgumentCompleter for EnvironmentCompleterAttribute. Nov 24, 2021
@LucasYao93 LucasYao93 changed the title [Account] IArgumentCompleter for EnvironmentCompleterAttribute. [Account] Use IArgumentCompleter to implement Environment parameter auto completer. Nov 24, 2021
@LucasYao93 LucasYao93 changed the title [Account] Use IArgumentCompleter to implement Environment parameter auto completer. [Account] Use IArgumentCompleter to implement the Environment parameter auto completer. Nov 24, 2021
@LucasYao93
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@isra-fel isra-fel left a comment

Choose a reason for hiding this comment

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

Hey @LucasYao93 , why was the old implementation not working?

@LucasYao93
Copy link
Contributor Author

Hey @LucasYao93 , why was the old implementation not working?
Old implementation is work. But I think that we should to use IArgumentCompleter to implement it instead of using ScriptBlock. Because [Microsoft.Azure.Commands.Profile.Common.EnvironmentCompleterAttribute]::GetEnvironments() in the ScriptBlock maybe cause issue when modify EnvironmentCompleterAttribute.

@isra-fel isra-fel self-assigned this Dec 1, 2021
@LucasYao93
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@LucasYao93
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@msJinLei
Copy link
Contributor

msJinLei commented Dec 2, 2021

/azp run azure-powershell - powershell-core

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

wyunchi-ms
wyunchi-ms previously approved these changes Jan 11, 2022
@wyunchi-ms
Copy link
Contributor

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@wyunchi-ms
Copy link
Contributor

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@wyunchi-ms wyunchi-ms merged commit 819b459 into main Jan 20, 2022
@wyunchi-ms wyunchi-ms deleted the lucas/issue-15991 branch May 24, 2022 04:08
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.

Add Environment auto completer to cmdlets of Az.Accounts
5 participants