Kieranties / PS-Pushover

A Powershell module to send messages using the Pushover API
7 stars 6 forks source link

PS-Pushover

A PowerShell module to send messages over the Pushover API

Requires: PowerShell 3.0

Install

To get up and running using the module run the following

<#
    .SYNOPSIS
    Simple install script for PS-Pushover
#>

$moduleName = "PS-Pushover"
$branch = "master"
$urlStub = "https://raw.github.com/Kieranties/$moduleName/$branch/"
$psm = "$urlStub$moduleName.psm1"

$client = New-Object System.Net.WebClient
$modPath = $env:PSModulePath.Split(";") | ? { $_ } | select -First 1 # or wherever you put your modules
$modFolder = New-Item (Join-Path $modPath $moduleName) -ItemType directory -Force # force used so you can use same script to update

$psm | % {
    $fileName = Split-Path $_ -leaf
    $client.DownloadFile($_, (Join-Path $modFolder $filename))
}

"$moduleName install complete"

Setup

You'll need to do the following before making use of the module

Create a Pushover Application

(Optional) Setting session parameters in profile

The function Send-PushoverMessage (aliased to spm) allows all parameters to be passed in each call. If you're going to be using the function often, it's easier to set things once.

In your profile you can do the following:

    Import-Module PS-Pushover
    Set-PushoverSession -token <your API Token> -user <your User Key>

Other options are also available, call Set-PushoverSession -detailed for more information

Functions

The full list of functions available are:

Examples

Some gist examples are available


Links