Search code examples
powershellamazon-rdsremote-desktop

Powershell: count properties SIZE block


I created following PowerShell line:

$size = (Get-RDSessionCollection -ConnectionBroker $CB |  select Collectionname, Size |ft)

as results I got:

CollectionName Size


Collection1 4
Collection2 29
Collection3 7

How may I count the size property (in this case 4+29+7=40). Thank You.


Solution

  • To calculate the Size you can do:

    $size = (Get-RDSessionCollection -ConnectionBroker $CB |  measure-object -property size -sum).sum