Microsoft Virtualization Discussions

Get-NaVol -Aggregate

cguldelmco

I am trying to list my Aggr/Volumes using

$allaggr = Get-NaAggr | sort -property name

foreach ($aggr in $allaggr) {

     $allvol = Get-NaVol -Aggregate $aggr | sort -property name

     foreach ($volume in $allvol) {

          write-host $aggr.name, $volume.name

     }

}

I get only a list of the Aggregates but no Volumes.

The WebDoc doesn't list the -Aggregate option but the get-help Get-Navol -Detailed does.

1 ACCEPTED SOLUTION

paleon

Replace:

$allvol = Get-NaVol -Aggregate $aggr | sort -property name

with

$allvol = Get-NaVol -Aggregate $aggr.name | sort -property name

The -Aggregate flag is expecting a string with the aggregate name, not an aggregate object.

View solution in original post

2 REPLIES 2

paleon

Replace:

$allvol = Get-NaVol -Aggregate $aggr | sort -property name

with

$allvol = Get-NaVol -Aggregate $aggr.name | sort -property name

The -Aggregate flag is expecting a string with the aggregate name, not an aggregate object.

View solution in original post

cguldelmco

Doh!

It was right in front of me.

Thanks

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public