Wednesday, December 23, 2009

Running PowerShell in the Cloud (with Azure)

There's a PowerShell Azure sample application HERE.

Briefly, in Azure terminology, the sample provides:

  1. The code to create a ASP.NET web role, which acts as the Internet-accessible web page that provides a simple interface to type in PowerShell code.
  2. The sample also provides the code to create a PowerShell worker role, which is basically C# code creating a PowerShell runspace which takes the input from the ASP.NET interface.
  3. So once a PowerShell command is passed via the web interface, it is passed to the PowerShell runspace.  Once the PowerShell runspace finishes the command passed, it returns the results back to the ASP.NET page to display.

I built the project yesterday using Visual Studio 2010 Beta 2.  Here’s the resulting Azure application:  (This link may be removed early in 2010 once Azure becomes a paid service.)

Give the above link a try.  For example, try “get-service cl*”.

Assuming this is PowerShell version 2.0, it is a very restricted runspace, and some commands just won’t return any results…

Tuesday, December 1, 2009

Adding sounds to PowerGadgets

PowerGadgets is my favorite PowerShell add-on.  I think it is time to think up more usage examples now that PowerShell v2 is “mainstream”.

I was checking out the PowerGadgets support forums last week and came across a question HERE about whether sound could be added to a gadget when the data changes.

Well, you can do just about anything with PowerShell and PowerGadgets, and adding sound is a piece of cake.  Here’s my guest blog post on how to do this HERE.

I also have a guest blog post there on creating a stock ticker and a flashing display…