Skip to main content

How to List The Capacity attributes for Dynamodb table with powershell

I was muddling around attempting to find  away to display the ReadCapacity and WriteCapacity for the dyanmodb table with powersheel. Wanted to share this as it took me quite bit of trial error before getting this right.


$PrimaryRegion = 'ap-southeast-2'
$ddbtablelist = Get-DDBTableList -Region $PrimaryRegion 


foreach ($ddbtablelist_item in $ddbtablelist)
{    
   Get-DDBTable -Region $PrimaryRegion -TableName $ddbtablelist_item |Select-Object  TableName , ItemCount, @{Name="ProvisionedThroughput";Expression={ $_.ProvisionedThroughput |  Select-Object ReadCapacityUnits ,WriteCapacityUnits}}|Select-Object -Property * -ExcludeProperty  ProvisionedThroughput -ExpandProperty ProvisionedThroughput}


Comments