Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Posting to Campfire from PowerShell
param (
[string]$RoomNumber = (Read-Host "The room to post to (default: 123456) "),
[string]$Message = (Read-Host "The message to send ")
$defaultRoom = "123456"
if ($RoomNumber -eq "") {
$RoomNumber = $defaultRoom
$authToken = "YOUR AUTH TOKEN"
$postUrl = "{0}/speak.json" -f $RoomNumber
$data = "`"{'message':{'body':'From PowerShell: - " + $message'}}`""
$command = "curl -i --user {0}:X -H 'Content-Type: application/json' --data {1} {2}" -f $authToken, $data, $postUrl
$result = Invoke-Expression ($command)
if ($result[0].EndsWith("Created") -ne $true) {
Write-Host "Error!" -foregroundcolor red
else {
Write-Host "Success!" -foregroundcolor green

This comment has been minimized.

Copy link

anderssonjohan commented Dec 4, 2013


Need support for sound messages? We've got it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.