Public/Channels/Restore-MMChannel.ps1

# Восстановление удалённого (архивированного) канала MatterMost

function Restore-MMChannel {
    <#
    .SYNOPSIS
        Restores a deleted (archived) MatterMost channel.
    .EXAMPLE
        Restore-MMChannel -ChannelId 'abc123'
    .EXAMPLE
        Get-MMChannel -ChannelId 'abc123' | Restore-MMChannel
    #>

    [CmdletBinding()]
    [OutputType('MMChannel')]
    param(
        [Parameter(Mandatory, ValueFromPipelineByPropertyName)]
        [Alias('id')]
        [string]$ChannelId
    )

    process {
        Invoke-MMRequest -Endpoint "channels/$ChannelId/restore" -Method POST |
            ConvertTo-MMChannel
    }
}