Powershell function to send push notifications to iPhone, iPad, or Android devices using the Instapush notification service. Utilizes the Invoke-RestMethod and ConvertTo-Json cmdlets.

function Send-InstapushNotification() {
    Instapush makes it easy to get real-time notifications on your Android device, iPhone, and iPad
    Instapush allows you to issue an http request, and have a notification delivered to your device.
    .PARAMETER applicationID
    (required) - your apps application ID
    .PARAMETER applicationSecret
    (required) - your application secret
    .PARAMETER pushArray
    (required) - An array containing your event and tracker information

    $trackers = @{email='rabble'}
    $push = @{event='test'; trackers=$trackers}
    Send-InstapushNotification -applicationID xxxxxxxxxxxx -applicationSecret xxxxxxxxxxxx -pushArray $push
    InstaPush API Documentation: https://instapush.im/developer/rest
    Invoke-RestMethod Technet Article: http://technet.microsoft.com/en-us/library/hh849971.aspx

    ConvertTo-Json Technet Article: http://technet.microsoft.com/en-us/library/hh849922.aspx


    # build the notification    
    $httpHeaders = @{}
    # send the notification
    $result = Invoke-RestMethod -Uri 'https://api.instapush.im/v1/post' -Headers $httpHeaders -Body ($pushArray | ConvertTo-Json -Compress) -Method Post -ErrorAction SilentlyContinue
    return $result