Quantcast
Channel: ONTAP Discussions topics
Viewing all articles
Browse latest Browse all 4869

How to combine Get-NcSnapshot & Get-NcAggr in a Powershell script

$
0
0

Hi,

 

I am trying to create a simple powershell script to generate snaps older than x days, that bit is easy.

 

However, Get-NcSnapshot does not yeild 'Aggr' Name, so I have added :

Get-NcAggr | where { $_.Volume -eq $x.Volume }

 

Objective: Getting snapshots older than x days is a bit and it gives information about which volume and vserver it belongs to along with the size of the snap, but it does not tell you which aggregate the snapshot-volume belongs to. Especially in a thin environment, where you can give back space to aggr by removing the snapshot.

 

Finally outputing it to CSV, problem is : Both Get-NcSnapshot & Get-NaAggr has common 'Name' column, hence it ignores the Aggr name, and simply populates the Agg 'Name' column with 'volumename'.

 

 

Is there a way to combine both these commands despite having same column name 'Name'?

 

Thanks,
-Ashwin


Viewing all articles
Browse latest Browse all 4869

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>