Heelo PS Toolkit gurus,
My code (browed from here and modified to my purpose).
$DataVservers = Get-NcVserver | Where-Object {$_.VserverType -eq "data"}
ForEach ($Vserver in $DataVservers) {
Get-NcEfficiency -vserver $Vserver |
Sort-Object vserver | Select-Object Vserver, Name, @{ 'N'="Cpacity"; "E"={ ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $_.Capacity }}, @{ 'N'="Used"; "E"={ ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $_.Used }}, @{ 'N'="Free"; "E"={ ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $_.Free }} |format-table -Autosize
}
There is a dataprotection SVM on the cluster. Script displays ok until hit the DR-SVM. It throws this error and continue with the rest of the SVMs
Get-NcEfficiency : Object reference not set to an instance of an object.
At line:2 char:1
+ Get-NcEfficiency -vserver $Vserver |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (xx.xxx.xxx.xxx:NcController) [Get-NcEfficiency], NullReferenceException
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Toolkit.Efficiency.GetNcEfficiency
Any work around to supress this error and display the data for the DR-SVM also?
Thanks