Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! See The Solution
1 ACCEPTED SOLUTION
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
2 REPLIES 2
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Doh!
It was right in front of me.
Thanks
