• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 43
  • Last Modified:

Azure Powershell Error. Cannont Bind Parameter

Hello Experts,

Can someone let me know why I'm getting the error, 'Cannot bind parameter 'Credential' when I run the following Azure Powershell commands

PS C:\WINDOWS\system32> Import-Module -Name "C:\Program Files\WindowsPowerShell\Modules\AzureRM.Profile\2.1.0\AzureRM.Profile.psm1" -Global

PS C:\WINDOWS\system32> Add-AzureAccount -Credential System.Management.Automation.PSCredential

Open in new window


The full error is shown in the image below:

Example Project
Thanks in advance

Carlton
0
Member_2_7966113
Asked:
Member_2_7966113
  • 2
1 Solution
 
MichelangeloConsultantCommented:
System.Management.Automation.PSCredential written this way is a string.
Without examining details of add-azureaccount, try this:
$mycred = get-credential
add-azureaccount -credential $mycred

Open in new window

0
 
Member_2_7966113Author Commented:
Thanks Michelangelo,

That worked fine.

Thanks
0
 
Member_2_7966113Author Commented:
Cheers mate
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now