Not only is this great bedtime reading if counting sheep just isn’t working for you, but when you wake up the following day you’ll have opened up some new possibilities with PowerShell.
The .NET framework contains numerous classes and interfaces which you can leverage from within PowerShell. Want to send an email from PowerShell? Check out System.Net.Mail. There are many examples of how to use each within PowerShell, found through your favourite search engine.
Anyway, here it is. Enjoy: http://msdn.microsoft.com/library/vstudio/gg145045(v=vs.110).aspx