PowerShell module for sending notifications using the Ntfy service, supporting messages, actions, attachments, and more.
NtfyPwsh is a PowerShell module for sending notifications using the Ntfy service. This module allows you to send messages with various actions, attachments, and other customizations.
- 🔹PowerShell 7 or higher
- 🔹Access to the internet or your self-hosted Ntfy server*
- 🔹Windows (Linux works for sure but not fully tested yet for everything.)
The module is hosted on the Powershell Gallery
Install-Module -Name NtfyPwshSends a notification using the Ntfy service.
Note: As of v0.4.0, authentication uses
-TokenCreds(API token viaGet-Credential) or-Credential(username/password viaGet-Credential). The-TokenPlainTextparameter has been removed.
Title(String, Optional): The title of the notification.Body(String, Optional): The body content of the notification.URI(String, Optional): The base URI of the Ntfy service. Default is ntfy.sh or enter self-hosted URL.Note: If
-URIis not specified, messages are sent to the free public ntfy.sh server. Topics are public and there are limitations. See public topics and limitations in the ntfy documentation for details.Topic(String, Mandatory): The topic for the notification. No spaces or special characters.TokenCreds(PSCredential, Optional): Credentials for Bearer token authentication (useGet-Credentialand enter the API token as the password).Credential(PSCredential, Optional): Credentials for basic authentication (useGet-Credentialfor username/password).Priority(String, Optional): The priority of the notification (Max,High,Default,Low,Min).Tags(String[], Optional): Tags or emojis for the notification. TagListSkipCertCheck(Switch, Optional): Skip certificate validation (for self-signed SSL, PowerShell 7+ only).Delay(String, Optional): Delay for the notification (timestamp, duration, or natural language).OnClick(String, Optional): URL to open when the notification is clicked.Action(String[] or Object[], Optional): Actions for the notification. Use with Build-NtfyAction.AttachmentPath(String, Optional): Path to the local file to attach.AttachmentName(String, Optional): Custom name for the attachment file.AttachmentURL(String, Optional): URL of the attachment to include.Icon(String, Optional): Icon URL or emoji for the notification (Android only, PNG/JPEG or emoji).Email(String, Optional): Email address for the notification.Phone(String, Optional): Phone number for the notification (must be in + format).NoCache(Switch, Optional): Prevent message from being cached on the server.FirebaseNo(Switch, Optional): Prevent forwarding to Firebase (FCM).Markdown(Switch, Optional): Enable Markdown formatting in the body (sets Content-Type to text/markdown).
Builds actions for the Send-NtfyMessage -Action parameter. Up to 3 actions are allowed.
ActionView(Switch, Mandatory for view): Specify to create a 'view' action (open website/app).ActionHttp(Switch, Mandatory for http): Specify to create an 'http' action (send HTTP request).ActionBroadcast(Switch, Mandatory for broadcast): Specify to create a 'broadcast' action (Android only).Label(String, Mandatory): The label for the action button or link.URL(String, Mandatory for view/http): The URL associated with the action.Clear(Switch, Optional for view): If specified, clears the notification after the action is triggered.Method(String, Optional for http): HTTP method for http actions. Valid: 'GET', 'POST', 'PUT', 'DELETE'. Default: 'POST'.Body(String, Optional for http): Optional body content for http actions.Headers(Hashtable, Optional for http): Optional headers for http actions.ClearHttp(Switch, Optional for http): If specified, clears the notification after the http action is triggered.Intent(String, Optional for broadcast): Optional intent for broadcast actions (Android only).Extras(Hashtable, Optional for broadcast): Optional extras for broadcast actions (Android only).ClearBroadcast(Switch, Optional for broadcast): If specified, clears the notification after the broadcast action is triggered.
Check out the NtfyPwsh TMI Edition
See the Changelog for a history of notable changes to this module.
This project is licensed under the MIT License.