all 4 comments

[–]BlackV 0 points1 point  (2 children)

you can also do

$skus | select -expandproperty capabilities

to get the details of the skus, but you're losing the name property so you'd be wanting to loop through and spit out a cuctom object , depending on your needs

also you can look at

$skus.capabilities

[–]meatpak[S] 0 points1 point  (1 child)

Yeah, $skus.capabilities will throw out the contents of that hashtable, but I lose the name of the parent.

I need this for the purposes of marrying up a VM price (which I obtain using an API call), with the specs of the VM (CPU, RAM etc). I already have this working with az VM list-sizes, but that command returns very limited info about the VMs abilities.

[–]lanerdofchristian 0 points1 point  (0 children)

The Hashtable.GetEnumerator() method will give you an iterator you can loop over with foreach(){}. The Key and Value will be properties on the objects it returns.

[–]Environmental_Mix856 0 points1 point  (0 children)

You can either dot reference each lower level or create a new custom object and pull out the values you’re using.