Created
August 25, 2011 19:32
-
-
Save johnsheehan/1171603 to your computer and use it in GitHub Desktop.
Twilio .NET library from PowerShell example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// using Twilio; | |
// var twilio = new TwilioRestClient("accountSid", "authToken"); | |
// var msg = twilio.SendSmsMessage("+15551112222", "+15553334444", "Can you believe it's this easy to send an SMS?!"); | |
[System.Reflection.Assembly]::LoadFile("Twilio.Api.dll") | out-null | |
$twilio = new-object Twilio.TwilioRestClient("accountSid", "authToken") | |
$msg = $twilio.SendSmsMessage("+15551112222", "+15553334444", "Can you believe it's this easy to send an SMS?!") | |
// v2 | |
Add-Type -path "Twilio.Api.dll" | |
$twilio = new-object Twilio.TwilioRestClient("accountSid", "authToken") | |
$msg = $twilio.SendSmsMessage("+15551112222", "+15553334444", "Can you believe it's this easy to send an SMS?!") |
One fix, in Powershell v2, instead of [System.Reflection.Assembly]::LoadFile("path to twilio assembly") | out-null, you can use Add-Type -path "path to twilio assembly"
Nice!
$twilio = new-object Twilio.TwilioRestClient("accountSid", "authToken")
$msg = twilio.SendSmsMessage("+15551112222", "+15553334444", "Can you believe it's this easy to send an SMS with powershell too?!")
crap. no auto refresh in gist. well, what he said.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
like this