Skip to content

Instantly share code, notes, and snippets.

@hdurdle
Created January 7, 2017 20:55
Show Gist options
  • Save hdurdle/8a74bca3786a62702c4df2b47f63de5d to your computer and use it in GitHub Desktop.
Save hdurdle/8a74bca3786a62702c4df2b47f63de5d to your computer and use it in GitHub Desktop.
param (
[Parameter(Mandatory=$true)][string]$client,
[string]$title = "Test Title",
[string]$message = "Test Message"
)
$data = @{
id = '1'
jsonrpc = '2.0'
method='GUI.ShowNotification'
params = @{
title = $title
message = $message
}
}
$uri = 'http://' + $client + ':3005/jsonrpc'
$json = $data | ConvertTo-Json
$response = Invoke-RestMethod -Uri $uri -Method Post -Body $json -ContentType 'application/json'
$response.result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment