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.
BDD提供了脚本构架,你可以利用这套构架来编写定制的脚本,扩展BDD的功能。包括记录日志、访问和改变环境变量以及一些功能函数
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”.
标准的BDD脚本是WSF格式的,这允许我们在其他脚本中来使用它。BDD脚本依靠ZTIUtility.vbs来引用这些功能。
 
Understanding 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)
环境-配置由WMI获得和BDD自身的变量,允许在脚本中直接使用
日志-为所有bdd脚本提供日志记录
功能-提供大部分函数功能
数据库-连接并读取数据库
 
 
  • 收藏
  • 评论
  • 举报
提问和评论都可以,用心的回复会被更多人看到 评论
发布评论
相关文章