Subscribe
Accepted Solution

Question on new query syntax of ONTAP cmdlets

Hi

I'm a huge fan of the new concise query syntax (eg Get-NcVol -Query @{TotalSize="<$(700GB)"}) but what is the equivalent, please, for the -Attributes argument (to limit the amount of data returned)?

At the moment, I'm putting (eg):

$attrs = Get-NcVol -Template

Initialize-NcObjectProperty -Object $attrs -Name VolumeSpaceAttributes

$attrs.VolumeSpaceAttributes.Size = ""

get-ncvol -query @{"TotalSize"="<$(700GB)"} -Attributes $attrs

to show only the "Size" attribute.

Regards,

Richard.

Re: Question on new query syntax of ONTAP cmdlets

Hi Richard,

You can use the same syntax, just set the desired attributes to empty strings.  For example:

PS C:\Users\SBeam> Get-NcVol -Query @{"TotalSize"="<$(700gb)"} -Attributes @{"VolumeSpaceAttributes"=@{"Size"=""}}

Name                      State       TotalSize  Used  Available Dedupe Aggregate                 Vserver

----                      -----       ---------  ----  --------- ------ ---------                 -------

beam01_root_vol                         20.0 MB                                                   beam01

clusterdisks                           400.0 GB                                                   beam01

ds4                                    500.0 GB                                                   beam01

powershell                             400.0 GB                                                   beam01

testvol                                 12.0 GB                                                   beam01

Thanks,

Steven

Re: Question on new query syntax of ONTAP cmdlets

Steven,

Many thanks for that.

Would be good to have some examples of this in the "Making the most ..." document as I'm sure "most" scripts only need to "see" a small subset of the available data (and so limiting the amount of data in this way would be a win all round).

Regards,

Richard.