Team - I am new to powershell and I am trying to create a script which can show us aggregate size, physical-used, physical-used-percent and committed capacity. I have taken few scripts from here n there and tried creating one with my requirements. Except committed space I am able to get the data but all the result in getting imported in 1 cell. Also if someone can help in how to get committed capacity that would be great!!
$netappcs = gc E:\Script\Health_check\test.txt
Get-Module ImportExcel | Import-Module
Import-Module DataONTAP
$User = "*******"
$PWord = ConvertTo-SecureString -String '********' -AsPlainText -Force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
foreach($netapp in $netappcs)
{
Connect-NaController $netapp -Credential $cred
$a = Get-NcCluster
$clus = $a.ClusterName
#$clusip = $a.NcController
$b = Get-NcNode
$node = $b.Node
$nodehealth = $b.IsNodeHealthy
$Netagg = "aggr show -aggregate * -fields size, physical-used, physical-used-percent"
Invoke-NcSsh -Command $Netagg | Select-Object Value, NcController | Export-Excel -path "E:\Script\Aggregate_Utilization_-$((Get-Date).ToString('dd-MM-yyyy')).xlsx" -TableStyle Medium16 -AutoSize
}