Hello @mark_schuren,
Certain fields in the output object from PSTK are not returned by ZAPI, but rather created by PSTK to make life easier for us as users. Created is one of those fields. When PSTK receives a ZAPI response which includes the "AccessTime" property it calculates/creates and populates the properties "Created" and "AccessTimeDT" (and of course "AccessTime") in the object returned.
We can determine this using the Get-Member cmdlet for the snapshot object:
PS C:\Users\asull> Get-NcSnapshot -Template | Get-Member
TypeName: DataONTAP.C.Types.Snapshot.SnapshotInfo
Name MemberType Definition
---- ---------- ----------
Created AliasProperty Created = AccessTimeDT
Cumulative AliasProperty Cumulative = CumulativeTotal
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Validate Method void Validate()
AccessTime Property System.Object AccessTime {get;set;}
AccessTimeDT Property System.Nullable[datetime] AccessTimeDT {get;}
AccessTimeSpecified Property bool AccessTimeSpecified {get;set;}
Busy Property System.Nullable[bool] Busy {get;set;}
BusySpecified Property bool BusySpecified {get;set;}
Comment Property System.Object Comment {get;set;}
CompressionType Property System.Object CompressionType {get;set;}
ContainsLunClones Property System.Nullable[bool] ContainsLunClones {get;set;}
ContainsLunClonesSpecified Property bool ContainsLunClonesSpecified {get;set;}
CumulativePercentageOfTotalBlocks Property System.Object CumulativePercentageOfTotalBlocks {get;set;}
CumulativePercentageOfTotalBlocksSpecified Property bool CumulativePercentageOfTotalBlocksSpecified {get;set;}
CumulativePercentageOfUsedBlocks Property System.Object CumulativePercentageOfUsedBlocks {get;set;}
CumulativePercentageOfUsedBlocksSpecified Property bool CumulativePercentageOfUsedBlocksSpecified {get;set;}
CumulativeTotal Property System.Nullable[long] CumulativeTotal {get;}
CumulativeTotalBlocks Property System.Object CumulativeTotalBlocks {get;set;}
CumulativeTotalSpecified Property bool CumulativeTotalSpecified {get;set;}
Dependency Property System.Object Dependency {get;set;}
ExpiryTime Property System.Object ExpiryTime {get;set;}
ExpiryTimeDT Property System.Nullable[datetime] ExpiryTimeDT {get;set;}
ExpiryTimeSpecified Property bool ExpiryTimeSpecified {get;set;}
InfiniteSnaplockExpiryTime Property System.Nullable[bool] InfiniteSnaplockExpiryTime {get;set;}
InfiniteSnaplockExpiryTimeSpecified Property bool InfiniteSnaplockExpiryTimeSpecified {get;set;}
InofileVersion Property System.Object InofileVersion {get;set;}
InofileVersionSpecified Property bool InofileVersionSpecified {get;set;}
Is7ModeSnapshot Property System.Nullable[bool] Is7ModeSnapshot {get;set;}
Is7ModeSnapshotSpecified Property bool Is7ModeSnapshotSpecified {get;set;}
IsConstituentSnapshot Property System.Nullable[bool] IsConstituentSnapshot {get;set;}
IsConstituentSnapshotSpecified Property bool IsConstituentSnapshotSpecified {get;set;}
Name Property System.Object Name {get;set;}
NcController Property NetApp.Ontapi.Filer.C.NcController NcController {get;set;}
PercentageOfTotalBlocks Property System.Object PercentageOfTotalBlocks {get;set;}
PercentageOfTotalBlocksSpecified Property bool PercentageOfTotalBlocksSpecified {get;set;}
PercentageOfUsedBlocks Property System.Object PercentageOfUsedBlocks {get;set;}
PercentageOfUsedBlocksSpecified Property bool PercentageOfUsedBlocksSpecified {get;set;}
SnaplockExpiryTime Property System.Object SnaplockExpiryTime {get;set;}
SnaplockExpiryTimeDT Property System.Nullable[datetime] SnaplockExpiryTimeDT {get;set;}
SnaplockExpiryTimeSpecified Property bool SnaplockExpiryTimeSpecified {get;set;}
SnapmirrorLabel Property System.Object SnapmirrorLabel {get;set;}
SnapshotInstanceUuid Property System.Object SnapshotInstanceUuid {get;set;}
SnapshotOwnersList Property DataONTAP.C.Types.Snapshot.SnapshotOwner[] SnapshotOwnersList {get;set;}
SnapshotVersionUuid Property System.Object SnapshotVersionUuid {get;set;}
State Property System.Object State {get;set;}
Total Property System.Nullable[long] Total {get;}
TotalBlocks Property System.Object TotalBlocks {get;set;}
TotalSpecified Property bool TotalSpecified {get;set;}
Volume Property System.Object Volume {get;set;}
VolumeProvenanceUuid Property System.Object VolumeProvenanceUuid {get;set;}
Vserver Property System.Object Vserver {get;set;}
Notice how Created and Cumulative properties are both aliases.
The easiest way to get what you're asking for is to simply specify both the SnapmirrorLabel and AccessTime properties...
Get-NcVol $volume | Get-NcSnapshot -SnapName $snapshot -Attributes @{ AccessTime = ""; SnapmirrorLabel = "" } | Format-List
You could also use template objects if desired...
$template = Get-NcSnapshot -Template
$template.AccessTime = ""
$template.SnapmirrorLabel = ""
Get-NcVol $volume | Get-NcSnapshot -SnapName $snapshot -Attributes $template | Format-List
Finally, it's imperfect, but you can attempt to specify that all fields should be returned using this bit of script:
$template = Get-NcSnapshot -Template
$template.psobject.Properties | ?{ $_.IsGettable -eq $true -and $_.IsSettable -eq $true } | %{
$property = $_.Name
try {
$template.($property) = $true
} catch {
$template.($property) = $null
}
}
Get-NcVol $volume | Get-NcSnapshot -SnapName $snapshot -Attributes $template | Format-List
Note that it simply guesses as to an acceptable value for the property in order to force it to be returned by PSTK.
Hope that helps.
Andrew
If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.