-
Notifications
You must be signed in to change notification settings - Fork 4k
Add-AzureRmAccount - Add position to Credential, update parameter sets #3042
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
Conversation
…e either SubscriptionId or SubscriptionName
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 looks great. One required comment and a nit
private const string AccessTokenParameterSet = "AccessToken"; | ||
private const string SubscriptionNameParameterSet = "SubscriptionName"; | ||
private const string SubscriptionIdParameterSet = "SubscriptionId"; | ||
private const string UserParameterSetWithSubscriptionId = "UserWithSubscriptionId"; |
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.
Need to update the DefaultParameterSetName in the Cmdlet attribute to match one of the actual parameter sets (UserWithSubscriptionId is the best bet)
[Parameter(ParameterSetName = SubscriptionIdParameterSet, Mandatory = false, HelpMessage = "Optional credential")] | ||
[Parameter(ParameterSetName = SubscriptionNameParameterSet, Mandatory = false, HelpMessage = "Optional credential")] | ||
|
||
[Parameter(ParameterSetName = UserParameterSetWithSubscriptionId, Mandatory = false, HelpMessage = "Optional credential", Position = 0)] |
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.
Note: if there wasn't another change to make I would not make this comment. Please break the Parameter attributes over multiple lines so they are not so difficult to read in the default code review pane.
@markcowl addressed code review comments |
Doesn't work for 2 factor auth |
Comments
Fix for issue #2048 and #1102
Add position for Credential parameter so that the following is allowed:
Updated the parameter sets so that SubscriptionId and SubscriptionName are mutually exclusive. Parameter sets were split into two:
This allows for either parameter to be used in a parameter set, but not both.
This checklist is used to make sure that common issues in a pull request are covered by the creator. You can find a more complete discussion of PowerShell cmdlet best practices here.
Below in Overall Changes, check off the boxes that apply to your PR. For the categories that you did not check off, you can remove them from this body. Within each of the categories that you did select, make sure that you can check off all of the boxes.
For information on cleaning up the commits in your pull request, click here.
Overall Changes
General
Tests
Parameters
object
.ResourceGroup
type string marked as [ValueFromPipelineByPropertyName]ResourceName
type string marked as [ValueFromPipelineByPropertyName]HashTable