Project

PSDiscord

Simple PowerShell module allowing to send messages to Discord Channel over webhooks

Stars51
Forks7
Open issues2
PowerShell Gallery downloads174734
Releasev0.2.4
Language: PowerShell Updated: 2026-02-14T21:19:09.0000000+00:00

Curated Examples

Send a basic message

Use PSDiscord to send a short Discord webhook notification.

This pattern is useful when a script needs to announce a start, finish, or failure state.

It is adapted from the source example at Examples/Example - 1.ps1.

When to use this pattern

  • You need a lightweight webhook notification.
  • The webhook URL is supplied by configuration or a secret store.
  • The message can be plain text.

Example

Import-Module PSDiscord

$webhookUrl = Get-Content -LiteralPath "$PSScriptRoot\discord-webhook.txt" -Raw

Send-DiscordMessage `
    -WebHookUrl $webhookUrl `
    -Text 'Nightly checks started.' `
    -AvatarName 'Automation'

What this demonstrates

  • sending a plain Discord message
  • keeping the webhook URL outside the script
  • setting a readable sender name

Source