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

Get-AzureRmApiManagementUser - Parameter set name 'Find users' is not supported #4510

Closed
sdwheeler opened this Issue Aug 27, 2017 · 6 comments

Comments

Projects
None yet
6 participants
@sdwheeler
Member

sdwheeler commented Aug 27, 2017

Cmdlet(s)

Get-AzureRmApiManagementUser

Description

Reported by a user via LiveFyre:

When I use this command with just the context and email address, I get an error saying "Get AzureRmApiManagementUser : Parameter set name 'Find users' is not supported." Any idea why?

Reviewing the source code it looks like this is by design but the docs indicate this should work. We need to fix the code or change the documentation.

    public class GetAzureApiManagementUser : AzureApiManagementCmdletBase
    {
        private const string GetAll = "Get all users";
        private const string GetById = "Get user by ID";
        private const string FindBy = "Find users";

... 
// skipped lines

...

        public override void ExecuteApiManagementCmdlet()
        {
            if (ParameterSetName.Equals(GetAll))
            {
                var users = Client.UsersList(Context, null, null, null, null, null);
                WriteObject(users, true);
            }
            else if (ParameterSetName.Equals(GetById))
            {
                var user = Client.UserById(Context, UserId);
                WriteObject(user);
            }
            else
            {
                throw new InvalidOperationException(string.Format("Parameter set name '{0}' is not supported.", ParameterSetName));
            }
        }
...
@cormacpayne

This comment has been minimized.

Show comment
Hide comment
@cormacpayne

cormacpayne Sep 1, 2017

Member

@solankisamir Hey Samir, would you mind taking a look at this issue?

Member

cormacpayne commented Sep 1, 2017

@solankisamir Hey Samir, would you mind taking a look at this issue?

@durai89

This comment has been minimized.

Show comment
Hide comment
@durai89

durai89 Oct 9, 2017

Do we have any fix for this issue? I am facing the same, unable to fetch user details by email address. - Thanks.

durai89 commented Oct 9, 2017

Do we have any fix for this issue? I am facing the same, unable to fetch user details by email address. - Thanks.

@cormacpayne

This comment has been minimized.

Show comment
Hide comment
@cormacpayne
Member

cormacpayne commented Oct 9, 2017

@solankisamir

This comment has been minimized.

Show comment
Hide comment
@solankisamir

solankisamir Oct 9, 2017

Member

@cormacpayne yes I am aware of the issue.

Member

solankisamir commented Oct 9, 2017

@cormacpayne yes I am aware of the issue.

@CodeStoneK

This comment has been minimized.

Show comment
Hide comment
@CodeStoneK

CodeStoneK Oct 18, 2017

I am trying this command to get users in a group and see the same error. Any ETA on the fix?

$members = Get-AzureRmApiManagementUser -Context $ApimContext -GroupId $groupId

CodeStoneK commented Oct 18, 2017

I am trying this command to get users in a group and see the same error. Any ETA on the fix?

$members = Get-AzureRmApiManagementUser -Context $ApimContext -GroupId $groupId

solankisamir added a commit to solankisamir/azure-powershell that referenced this issue Oct 23, 2017

Fix Issue 4510 Get-AzureRmApiManagementUser
* Updated Cmdlet Get-AzureRmApiManagementUser to fix issue
Azure#4510

@solankisamir solankisamir referenced this issue Oct 23, 2017

Merged

[ApiManagement] Secure Parameter for Cmdlets #4837

12 of 13 tasks complete
@solankisamir

This comment has been minimized.

Show comment
Hide comment
@solankisamir

solankisamir Oct 25, 2017

Member

Fix for the issue should be available with https://github.com/Azure/azure-powershell/milestone/31

Member

solankisamir commented Oct 25, 2017

Fix for the issue should be available with https://github.com/Azure/azure-powershell/milestone/31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment