Get-Comment
  • 1 Minute to read
  • Dark
    Light
  • PDF

Get-Comment

  • Dark
    Light
  • PDF

Article summary

Summary

Retrieves an existing comment.

Get-Comment
    -Id

Returns a comment object.

Parameters

ParameterTypeRequired?Notes
IdInt32YesThe comment id.

Examples

Get an existing comment

This example retrieves a specific comment and outputs it as JSON.

# Retrieve a specific comment by id
$data = Get-Comment -Id 1

Write-Output "Retrieved comment $($data.CommentId)"

# Convert the data to output as JSON
$jsonOutput = $data | ConvertTo-Json -Depth 10

# For debug purposes, convert the data to output as JSON so we can see all the fields
Write-Output ""
Write-Output "JSON Results:"

$jsonOutput = $data | ConvertTo-Json -Depth 10

Write-Output $jsonOutput

Results of executing the script:

Retrieved comment 1

JSON Results:
{
  "Metadata": null,
  "Object": null,
  "CreatedBy": null,
  "ChildComments": [],
  "CommentId": 1,
  "ObjectId": 2,
  "ObjectName": "Matter",
  "PrimaryKeyId": 6,
  "RelatedCommentId": null,
  "Value": "<p>Contract officially closed on 1/1/2024.</p><p>We can begin collecting and processing data <strong>mid January</strong>.</p>",
  "CreatedByFullName": "Max Miller,
  "CreatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",
  "CreatedOn": "2024-03-04T14:40:06.3923796+00:00",
  "LastUpdatedByFullName": "Max Miller",
  "LastUpdatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",
  "LastUpdatedOn": "2024-03-04T14:40:06.3923796+00:00",
  "LastUpdatedBy": null
}

What's Next