Adding a Component Instance to a Configuration

Using SQE syntax, you can easily add component instances to a runtime configuration.

The following example shows how to load an existing configuration into memory, create a new instance of Internet Explorer, and then add an instance of Internet Explorer to the configuration.

xpecmd> load cfg "c:\myimages/image.slx"
xpecmd> new myInst Instance
xpecmd> myInst = 'inst:^Internet Explorer'
xpecmd> cfg.Instances.Add myInst

The following expression shows a more direct way of performing the above actions.

xpecmd> load cfg "c:\myimages/image.slx"
xpecmd> cfg.Instances.Add 'inst:^Internet Explorer'

XPECMD also provides a add command to perform this task.

xpecmd> load cfg "c:\myimages/image.slx"
xpecmd> add cfg 'inst:^Internet Explorer'

Note   In the preceding examples, Internet Explorer dependencies are not resolved. The configuration object provides methods to check and automatically resolve dependencies. For more information, see Checking and Resolving Dependencies.

Last updated on Wednesday, October 18, 2006

© 2006 Microsoft Corporation. All rights reserved.