OK, slowly making progress. I changed the AddCode section to create a function and then called that function by name in the Run section as follows:

 Code:
$strCommand = 'Function CO
Set Session = CreateObject("Microsoft.Update.Session","' + $strWks + '")
End Function'
$objSC.AddCode($strCommand)
$objSC.Run("CO")


That all passes without any errors. I'm now getting an error on the
 Code:
$objSession = $objSC.CodeObject.Session


I'll have to check that syntax.

\:\)


Edited by BradV (2011-11-21 02:10 PM)
Edit Reason: Corrected typo