This will get all the volumes on the connected NetApp. The list will be sorted by name. Then, for each volume, the list of snapshots is gathered and sorted by the "Created" property. The list of snapshots is then added as a new member property of the volume object.
Now, the $vols object contains an array of volumes (or a single volume if only one volume exists). Each volume object contains a property named "Snapshots." If the volume contained no snapshots (or if the Get-NaSnapshot commandlet encountered an error), the Snapshots property will be $null. If the volume contained snapshots, the array of snapshots (or a single snapshot object if only one existed) will be stored in that property.
If you want the last snapshot object for a volume, the command would look like this.
Don't sort by the "Created" property. It does not sort the column as dates, but rather as strings. So, you'll see something like this:
Instead, sort by the "AccessTime" property. This property does not seem to change when you create a flexclone from the snapshot, so I'm not sure why it's named "AccessTime". But either way, it's the number of seconds since Epoch, so it's pretty easy to sort by.