nam
nam

Reputation: 23868

The term 'Set-AzureKeyVaultKeyAttributes' is not recognized as the name of a cmdlet,

On my Windows 10 I've Powershell 5.0 installed. But when I run the following command on it, I get the above error.

PS command:

Set-AzureKeyVaultKeyAttributes -Name Key2 -VaultName KayVault-abctest -Enable $false

Error

Set-AzureKeyVaultKeyAttributes : The term 'Set-AzureKeyVaultKeyAttributes' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Set-AzureKeyVaultKeyAttributes -Name Key2 -VaultName KayVault-abctest ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Set-AzureKeyVaultKeyAttributes:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Note I'm using the topic Create a Key (Portal) in this official Azure lab tutorial.

Upvotes: 4

Views: 5747

Answers (1)

Micah R Ledbetter
Micah R Ledbetter

Reputation: 1096

I believe the name of the cmdlet should be the singular Set-AzureKeyVaultKeyAttribute, rather than the plural Set-AzureKeyVaultKeyAttributes. Note that this is one of the Strongly Encouraged Development Guidelines for Powershell by Microsoft:

To enhance the user experience, the noun that you choose for a cmdlet name should be singular. For example, use the name Get-Process instead of Get-Processes. It is best to follow this rule for all cmdlet names, even when a cmdlet is likely to act upon more than one item.

If you are still seeing the same problem while using a singular name, ensure that the AzureRM.KeyVault module is installed and loaded:

Install-Module AzureRM.KeyVault
Import-Module AzureRM.KeyVault

Upvotes: 5

Related Questions