cmdletGet-AzTableRow
参数 -table 应接受类型“CloudTable”,但 cmdlet Get-AzStorageTable 的输出类型为“AzureStorageTable”,因此它们不匹配。
如果您好奇,可以检查它是 CosmosDB 表类型:
$cloudTable | gm
TypeName: Microsoft.Azure.Cosmos.Table.CloudTable
Name MemberType Definition
---- ---------- ----------
Create Method void Create(System.Nullable[Microsoft.Azure.Cosmos.IndexingMode] indexingMode, System.Nullable[int] throughput, System.Nullable[int] defaultTime...
CreateAsync Method System.Threading.Tasks.Task CreateAsync(), System.Threading.Tasks.Task CreateAsync(System.Threading.CancellationToken cancellationToken), System...
CreateIfNotExists Method bool CreateIfNotExists(Microsoft.Azure.Cosmos.IndexingMode indexingMode, System.Nullable[int] throughput, System.Nullable[int] defaultTimeToLive...
CreateIfNotExistsAsync Method System.Threading.Tasks.Task[bool] CreateIfNotExistsAsync(), System.Threading.Tasks.Task[bool] CreateIfNotExistsAsync(System.Threading.Cancellati...
CreateQuery Method Microsoft.Azure.Cosmos.Table.TableQuery[TElement] CreateQuery[TElement]()
Delete Method void Delete(Microsoft.Azure.Cosmos.Table.TableRequestOptions requestOptions, Microsoft.Azure.Cosmos.Table.OperationContext operationContext)
DeleteAsync Method System.Threading.Tasks.Task DeleteAsync(), System.Threading.Tasks.Task DeleteAsync(System.Threading.CancellationToken cancellationToken), System...
DeleteIfExists Method bool DeleteIfExists(Microsoft.Azure.Cosmos.Table.TableRequestOptions requestOptions, Microsoft.Azure.Cosmos.Table.OperationContext operationCont...
DeleteIfExistsAsync Method System.Threading.Tasks.Task[bool] DeleteIfExistsAsync(), System.Threading.Tasks.Task[bool] DeleteIfExistsAsync(System.Threading.CancellationToke...
Equals Method bool Equals(System.Object obj)
Execute Method Microsoft.Azure.Cosmos.Table.TableResult Execute(Microsoft.Azure.Cosmos.Table.TableOperation operation, Microsoft.Azure.Cosmos.Table.TableReques...
ExecuteAsync Method System.Threading.Tasks.Task[Microsoft.Azure.Cosmos.Table.TableResult] ExecuteAsync(Microsoft.Azure.Cosmos.Table.TableOperation operation), Syste...
ExecuteBatch Method Microsoft.Azure.Cosmos.Table.TableBatchResult ExecuteBatch(Microsoft.Azure.Cosmos.Table.TableBatchOperation batch, Microsoft.Azure.Cosmos.Table....
ExecuteBatchAsync Method System.Threading.Tasks.Task[Microsoft.Azure.Cosmos.Table.TableBatchResult] ExecuteBatchAsync(Microsoft.Azure.Cosmos.Table.TableBatchOperation ba...
ExecuteQuery Method System.Collections.Generic.IEnumerable[Microsoft.Azure.Cosmos.Table.DynamicTableEntity] ExecuteQuery(Microsoft.Azure.Cosmos.Table.TableQuery que...
ExecuteQuerySegmented Method Microsoft.Azure.Cosmos.Table.TableQuerySegment[Microsoft.Azure.Cosmos.Table.DynamicTableEntity] ExecuteQuerySegmented(Microsoft.Azure.Cosmos.Tab...
ExecuteQuerySegmentedAsync Method System.Threading.Tasks.Task[Microsoft.Azure.Cosmos.Table.TableQuerySegment[Microsoft.Azure.Cosmos.Table.DynamicTableEntity]] ExecuteQuerySegment...
Exists Method bool Exists(Microsoft.Azure.Cosmos.Table.TableRequestOptions requestOptions, Microsoft.Azure.Cosmos.Table.OperationContext operationContext)
ExistsAsync Method System.Threading.Tasks.Task[bool] ExistsAsync(), System.Threading.Tasks.Task[bool] ExistsAsync(System.Threading.CancellationToken cancellationTo...
GetHashCode Method int GetHashCode()
GetPermissions Method Microsoft.Azure.Cosmos.Table.TablePermissions GetPermissions(Microsoft.Azure.Cosmos.Table.TableRequestOptions requestOptions, Microsoft.Azure.Co...
GetPermissionsAsync Method System.Threading.Tasks.Task[Microsoft.Azure.Cosmos.Table.TablePermissions] GetPermissionsAsync(), System.Threading.Tasks.Task[Microsoft.Azure.Co...
GetSharedAccessSignature Method string GetSharedAccessSignature(Microsoft.Azure.Cosmos.Table.SharedAccessTablePolicy policy), string GetSharedAccessSignature(Microsoft.Azure.Co...
GetType Method type GetType()
SetPermissions Method void SetPermissions(Microsoft.Azure.Cosmos.Table.TablePermissions permissions, Microsoft.Azure.Cosmos.Table.TableRequestOptions requestOptions, ...
SetPermissionsAsync Method System.Threading.Tasks.Task SetPermissionsAsync(Microsoft.Azure.Cosmos.Table.TablePermissions permissions), System.Threading.Tasks.Task SetPermi...
ToString Method string ToString()
Name Property string Name {get;}
ServiceClient Property Microsoft.Azure.Cosmos.Table.CloudTableClient ServiceClient {get;}
StorageUri Property Microsoft.Azure.Cosmos.Table.StorageUri StorageUri {get;}
Uri Property uri Uri {get;}
因此,首先您需要通过以下方式获取对此对象类型的引用:
$cloudTable = (Get-AzStorageTable –Name $tableName –Context $ctx).CloudTable
然后在命令中使用它:
Get-AzTableRow -Table $cloudTable
请参考官方文档:
https ://docs.microsoft.com/en-us/azure/storage/tables/table-storage-how-to-use-powershell#reference-cloudtable-property-of-a-specific -桌子