Add-TaskSubscriber

Prev Next

Summary

Creates a new task subscriber.

Add-TaskSubscriber
    -Entry
    -IncludeTask
    -IncludeUser

Returns the created task subscriber object.

Parameters

Parameter

Type

Required?

Notes

Entry

Task subscriber object

Yes

The task subscriber object to create as a new entry.

IncludeTask

Switch

No, defaults to False

Includes the Task property in the output.

IncludeUser

Switch

No, defaults to False

Includes the User property in the output.Ex

Examples

Add a subscriber to a task

# Create a task subscriber object with required fields
$entry = @{
    TaskId = 1123
    UserId = "510e109b-6ff5-4442-9670-cd5e3cd82a7a"
}

$createdEntry = Add-TaskSubscriber -Entry $entry

# Output some information to help indicate that the task is marked in progress
Write-Output "$($createdEntry.UserFullName) has just been subscribed to task $($createdEntry.TaskId) ($($createdEntry.TaskName))"

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

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

# Output the data
Write-Output $jsonOutput

Execution results:

Max Miller has just been subscribed to task 1123 (Monthly KPI Review)

JSON Results:
{
  "TaskSubscriberId": 308,
  "TaskId": 1123,
  "TaskName": "Monthly KPI Review",
  "UserId": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "UserFullName": "Max Miller",
  "UserEmail": "mmiller@agilityblue.com",
  "UserNotificationsEnabled": true,
  "UserIsTeamAccount": false,
  "AdditionalInformation": null,
  "CreatedByFullName": "Max Miller",
  "CreatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "CreatedOn": "2025-07-16T15:19:48.276851+00:00",
  "CreatedBy": null
}