Skip to content

Get-MgmtGraphGroupConversationThreadPostCount

MgmtGraph: Retrieves the count of posts in a conversation thread

#Requires -Version 5.1
#Requires -Modules Microsoft.Graph.Groups

[CmdletBinding()]
Param (
    [Parameter(Mandatory = $true, Position = 0)]
    [string]$GroupId,

    [Parameter(Mandatory = $true, Position = 1)]
    [string]$ConversationId,

    [Parameter(Mandatory = $true, Position = 2)]
    [string]$ConversationThreadId
)

Process {
    try {
        $params = @{
            'GroupId'              = $GroupId
            'ConversationId'       = $ConversationId
            'ConversationThreadId' = $ConversationThreadId
            'ErrorAction'          = 'Stop'
        }

        $count = Get-MgGroupConversationThreadPostCount @params
        
        $result = [PSCustomObject]@{
            GroupId              = $GroupId
            ConversationId       = $ConversationId
            ConversationThreadId = $ConversationThreadId
            PostCount            = $count
            Timestamp            = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
        }

        Write-Output $result
    }
    catch {
        throw
    }
}

The unique identifier of the Microsoft Graph group.

The unique identifier of the target conversation.

The unique identifier of the target conversation thread.

An interactive directory of PowerShell scripts.