To create your contexts, how about:

$SMSContext = CreateObject("WbemScripting.SWbemNamedValueSet")

$SMSContext.Add("LocaleID", "MS\1033")
$SMSContext.Add("MachineName", "MyMachine")
$SMSContext.Add("ApplicationName", "MyApp")

Just a wild quess from the spongster.