BDD provides a scripting framework, by leveraging this framework you can write a custom script that can utilize the functionality that BDD provides. This functionality includes a logging, accessing and changing environment variables and a number of utility functions.
Before describing how to create a script it is best to review how the scripts included with BDD are constructed.
在阐述如何创建一个新脚本之前,我们最好来复习一下BDD中的脚本是如何构建的。
The standard BDD script is a WSF file, this allows references to be made to functions that are contained in other scripts. BDD scripts leverage this functionality by referencing a script called “ZTIUtility.vbs”.
ZTIUtility.vbs is used to initialize the BDD environment and setup classes, these can then be used by scripts that reference it.
ZTIUtility.vbs用于初始化BDD环境和安装类别,然后可以被脚本调用
The script defines a number of standard objects:
oFSO – File System Object
oShell – Wscript Shell object
oEnv - Process Environment object
oNetwork - WScript Network object
Note: You do not need to declare these objects in your script.
注意,你不需要在脚本中声明这些对象
Four classes are defined which perform a number of standard tasks:
有四种用于执行各种标准任务的类:
Environment – This configures environment variables gather via WMI and BDD rule processing and allows you to reference these directly I from you script
Logging – Provides the logging functionality used by all BDD scripts, creating a single log file for each script and a consolidated log file of all scripts
Utility – Provides general utility functionality
Database – performs functions such as connecting to databases and reading information from databases (See this blog for further information)