I'm trying to write a simple script that looks at snapshots on a set of volumes, and gathers things like (number of snapshots, latest snapshot, oldest snapshot).
For each snapshot I would like things like Name, AccessTime(snap create time), SnapLockExpiryTime, SnapMirrorLabel)...
Sounds simple... but it seems that the API still seems to have a lot of the old issue that I used to fight with in the past...
I start with:
Get-NcSnapshot -vserver blah -volume volblah | Select Name, AccessTime, SnapLockExpiryTime, SnapMirrorLabel
I then run the resulting object via this:
$Snapshots | Where-Object -Property Name -NotLike "snapmirror*" | Sort-Object -Property AccessTime | Select-Object -Last 1
To get the latest snapshot and replace "-Last" with "-First" to get the oldest snapshot.
`Name : 6hourly.2025-12-09_1816
AccessTime : 2025-12-09T15:16:01+01:00
SnaplockExpiryTime : 1765793323
SnapmirrorLabel : 6hourly
Name : Au NFS01_08-02-2025_00.00.03.0255
AccessTime : 2025-08-02T00:00:19+02:00
SnaplockExpiryTime : 1762009548
SnapmirrorLabel : daily`
Problem is, this takes forever. And notice that the two versions of time that is returned... just beautiful ?