Public/Slack/Channel/Add-SlackChannel.ps1

function Add-SlackChannel {

    [CmdletBinding()]
    param (

         [Parameter(Mandatory = $true)]
         [String]$Name        # Give the channel a name, this is the "identifier for this channel"

        ,[Parameter(Mandatory = $true)]
         [String]$Token

    )

    process {

        # Encrypt the token
        #$encryptedToken = Convert-PlaintextToSecure -String $Token

        # This is customised for Telegram
        $definition = [PSCustomObject]@{
            "token" = Convert-PlaintextToSecure -String $Token #$encryptedToken
        }

        Add-Channel -Type "Slack" -Name $Name -Definition $definition

    }

}