Add-AzTableRow命令在Azure Cloud Shell中不可用

问题描述 投票:0回答:1

我正在尝试使用Azure Cloud Shell在表存储中插入新行,但遇到以下异常。因此,让我知道我们需要用来插入的任何其他命令。

Blockquote

 Add-AzTableRow: The term 'Add-AzTableRow' 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.

Blockquote

以下是命令:

$partitionKey1 = "partition1"
$partitionKey2 = "partition2"


Add-AzTableRow `
    -table $cloudTable `
    -partitionKey $partitionKey1 `
    -rowKey ("CA") -property @{"username"="Chris";"userid"=1}
azure-storage azure-table-storage azure-cloud-shell
1个回答
0
投票

根据错误,看来您没有安装模块AzTable。请运行命令AzTable检查是否已安装模块。Get-InstalledModule

如果尚未安装模块,请运行命令enter image description here进行安装。

例如

Install-Module -Name AzTable -Force

Install-Module -Name AzTable -Force Import-Module AzTable $resourceGroup = "<your group name>" $storageAccountName ="<your account name>" $storageAccount=Get-AzStorageAccount -ResourceGroupName $resourceGroup -Name $storageAccountName $ctx = $storageAccount.Context $tableName = "<table name>" $cloudTable = (Get-AzStorageTable –Name $tableName –Context $ctx).CloudTable $partitionKey1 = "partition1" Add-AzTableRow -table $cloudTable -partitionKey $partitionKey1 -rowKey ("CA") -property @{"username"="Chris";"userid"=1}

© www.soinside.com 2019 - 2024. All rights reserved.