/Poshover

A PowerShell module for sending notifications / messages using the Pushover API

Primary LanguagePowerShellMIT LicenseMIT

Contributors Forks Stargazers Issues MIT License LinkedIn Twitter


Logo

Poshover - A PowerShell Module for Pushover

Send push notifications to mobile devices and desktops from PowerShell using the Pushover service!
Explore the docs »

Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

NOTICE

This repository is no longer maintained. The module has been renamed to joshooaj.PSPushover and a new repository has been created. The new repo has a number of improvements including:

  • Automatic documentation generation, updating, and publishing using PlatyPS, MkDocs, and GitHub Pages
  • Automatic building and testing on Linux, Windows, and MacOS
  • Automatic publishing of tagged versions to PSGallery after successfully passing tests
  • Automatic versioning using nbgv
  • Codespaces or devcontainer support
  • Built-in demo showing how a GitHub action runs and sends a notification when the repository gets starred

About The Project

Product Name Screen Shot

If you want to send push notifications to one or more mobile or desktop devices from PowerShell, that's exactly what this module is about. The module makes use of the Pushover.net notification service which is free for up to 10k notifications per month!

The goal of the module is to support as much of the Pushover API as possible. To start with, the messages endpoint is be supported using the Send-Pushover function, and the most common features including message priority, retry interval, expiration, and attachment capabilities are available.

Later, support will be added for additional features like checking receipt status, listing and specifying notification sounds, and other API areas like subscriptions, groups, licensing, etc.

Getting Started

Before you use Poshover and the Pushover API, you need a Pushover account and an application token.

Prerequisites

You need a Pushover account, a user or group key to which messages will be sent, and an application token to which

  1. Go sign up (for free) on Pushover.net and confirm your email address.
  2. Copy your user key and save it for later.
  3. Scroll down to Your Applications and click Create an Application/API Token.
  4. Give it a name (this will be the title of your push notifications when you don't supply your own title)
  5. Pick an icon. It's optional, but you really want your own icon :)
  6. Read the ToS and check the box, then click Create Application
  7. Save your API Token/Key for later. You're ready to install and click Back to apps or click on the Pushover logo in the title bar

Installation

Launch an elevated PowerShell session and run the following:

Install-Module -Name Poshover -AllowPrerelease

If that failed, you may need to update your PowerShellGet package provider. Try this:

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Install-PackageProvider -Name NuGet -Force
Install-Module -Name PowerShellGet -Force
Install-Module -Name Poshover -AllowPrerelease

Usage

Got your application token and user keys handy? Good!

$token = Read-Host -Prompt 'Application API Token' -AsSecureString
$user = Read-Host -Prompt 'User Key' -AsSecureString
Send-Pushover -Token $token -User $user -Message 'Have a nice day!'

Don't want to enter your token and user keys every time? You don't have to!

# This will securely save your token and user keys to %appdata%/Poshover/config.xml
$token = Read-Host -Prompt 'Application API Token' -AsSecureString
$user = Read-Host -Prompt 'User Key' -AsSecureString
Set-PushoverConfig -Token $token -User $user

Send-Pushover -Message 'You are fantastic!'

Building

The structure of the PowerShell module is such that the .\src\ directory contains the module manifest, .psm1 file, and all other functions/classes/tests necessary. The "build" process takes the content of the .\src\ directory, copies it to .\output\Poshover\version, and updates the module manifest to ensure all classes and functions are exported properly.

To build, simply run Invoke-psake build from the root of the project. And to test, run Invoke-psake test.

I like to also setup VSCode to launch .\debug.ps1 when I press F5. This will clear the .\output\ directory and call the psake build task, then force-import the updated module from the .\output\ directory. I find this makes the developer "inner-loop" really quick.

Also, I recommend using the Microsoft.Powershell.SecretManagement module for storing your api keys. That way you never enter them in clear text.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Josh Hendricks - @joshooaj

Project Link: https://github.com/jhendricks123/Poshover

Acknowledgements