Skip to content

Instantly share code, notes, and snippets.

View johnsibly's full-sized avatar

John Sibly johnsibly

View GitHub Profile
@johnsibly
johnsibly / post-message-to-teams.js
Last active January 8, 2024 13:27
Javascript for posting a message to a Microsoft Teams channel
'use strict';
const axios = require('axios'); // axios must be installed via npm i axios
const webhookURL = "https://outlook.office.com/webhook/1234567890"; // Replace with a valid webhool URL obtained by adding an "Incomming Webhook" connector to your teams channel
if (process.argv.length === 4) {
const title = process.argv[2];
const message = process.argv[3];
console.log(`${title}, ${message}`);
postMessageToTeams(title, message);
} else {