I'm writing a script that requires 3 attributes of a snapshot: Name, Created, and Comment. The problem I'm running into is twofold.
First, the Get-NcSnapshot command is not returning the Comment attribute of snapshots. According to the '-Attributes' parameter description: "If not specified, all data is returned for each object." However the Comment can only be retrieved when using the '-Attributes' parameter with an appropriate query template (e.g $query.Comment = $true). This would be fine except...
Second, when trying to set the query template to retrieve the Created field (e.g. $query.Created = $true) it returns an error:
'Created' is a ReadOnly property.
At line:1 char:1
+ $Query.Created = $true
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
I can retrieve all the information I need but it requires two calls to Get-NcSnapshot. The first to retrieve the bulk of the attributes, most of which I don't need, and an additional call just for the Comment.
Is there a way I can set the query template to retrieve the Created attribute? If not, can this be noted as a bug and fixed in the next release?