The Get-NaSnapshot cmdlet should return snapshot objects that include the creation time of the snapshot. This property is named "Created" and is of type System.DateTime.
Here is some sample code:
$vols = Get-NaVol | Sort-Object -Property "Name"
foreach ($vol in $vols) {
write-host "Processing $vol"
$snapshots = $null
$snapshots = Get-NaSnapshot -TargetName $vol.name | Sort-Object -Property "Created"
$vol | Add-Member -Name "Snapshots" -MemberType "NoteProperty" -Value $snapshots
}
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.
$volname = <name_of_volume_from_which_you_want_to_make_the_clone>
$volCloneParent = $vols | Where-Object {$_.name -eq $volname"}
$snapshots = $volCloneParent.Snapshots
$newestSnapshot = $snapshots[$snapshots.count-1]
$oldestSnapshot = $snapshots[0]
Please let me know whether this answers your question.
Bill