Subscribe
Accepted Solution

Get-NaVol -Aggregate

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.

Re: Get-NaVol -Aggregate

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.

Re: Get-NaVol -Aggregate

Doh!

It was right in front of me.

Thanks