hi everyone, I found a lot of great stuff on this site, and I am just starting with PS cmdlets and scripts, so I give this board a lot of credit for putting out cmdlets and help with code.
Here is the code that I have, and I want to include the Get-naVolSize into it.
Connect-NaController mysan
$AllAggr=Get-NaAggr
$AllVols=Get-NaVol
$AllLuns=Get-NaLun
foreach ($aggr in $AllAggr | sort Name){
write-Host $aggr.Name ($aggr.sizetotal / 1tb) 'TB'
Foreach ($volume in $AllVols | sort name){
If ($volume.ContainingAggregate -eq $aggr.Name){
Write-Host $volume.name' ' ($volume.sizetotal / 1gb)
}
}
}
this part is great and it shows me what I need to see with the aggregate size and volumes in that aggr and their size like so;
aggrSQL 3.7342484 TB
volume_sql1 200 Gb
volume_sql2 100 Gb
How can I also include the get-navolsize cmdlet into this...
what I want to be able to do is generate a similar output, but also show this;
volume_sql1 200 Gb free space left 138 Gb
volume_sql2 100 Gb free space left 20 Gb
I thought about delcaring $VolSize=Get-NaVolSize but I am not sure where to put that, I think I have to pass all the volumes from Get-NaVol to the Get-NaVolSize, but not sure where ?
Thank you.