Now that we have reviewed the framework lets look at how to write a custom script. I have created a script template below which is based on the structure used within the standard BDD scripts. The template is simply a wrapper that references the ZTIUtility.vbs script and  launches the function "ZTIProcess". To create your own script you simply place your code within the ZTIProcess function.
现在我们已经大致了解了构架,让我们来看看如何写一个脚本。我已经写好了一个模板,基于BDD的标准结构。这个模板简单的引用了ZTIUtility.vbs并使用了函数“ZTIProcess”。要建立你自己的脚本,
Here is a quick overview of the steps required to add your script to a BDD build:
  1. Create your script based on the template 基于模板创建你的脚本
  2. Place the script in the folder \Distribution\Scripts 把脚本放在\Distribution\Scripts
  3. Create an Application in the BDD Workbench that references this script 创建一个和脚本有关的应用程序
  4. Add the Application to the build task sequence把程序添加到ts中
It is also important to remember the following key rules when creating your script:
  1. Always declare variables 记得声明你的变量
  2. Only create objects where required - BDD creates most objects you will need需要时才创建对象
  3. Check if ZTIUtitlity provides the functionality you require before writing a function在写一个函数前先看看ZTIUtility是否提供了你需要的
  4. Script names should always start with a "Z" as BDD will replicate only scripts beginning with "Z" to other deployment points脚本名称一定以“Z”开头
Hopefully these tips will get you started, writing your own scripts that  leverage the true flexibility of BDD.

0

收藏

xmuxsp

207篇文章,86W+人气,2粉丝

Ctrl+Enter 发布

发布

取消

推荐专栏更多

5353379fc95da1d7d34fd243b9ace17f.jpg
全局视角看大型园区网

路由交换+安全+无线+优化+运维

共40章 | 51CTO夏杰
¥51.00 1682人订阅
45862f289339dc922ffda669fd74ad9b.jpg
网工2.0晋级攻略 ——零基础入门Python/Ansible

网络工程师2.0进阶指南

共30章 | 姜汁啤酒
¥51.00 1567人订阅
a940c66317ecbe58436a2ad3831c2d7d.png
基于Python的DevOps实战

自动化运维开发新概念

共20章 | 抚琴煮酒
¥51.00 430人订阅
629650e188ddde78b213e564c2e9ebff.jpg
负载均衡高手炼成记

高并发架构之路

共15章 | sery
¥51.00 507人订阅
dc6736c5fd50474b5df8b76b040e3d03.jpg
带你玩转高可用

前百度高级工程师的架构高可用实战

共15章 | 曹林华
¥51.00 462人订阅
f92360e227f9d91cdff7ea95120630ef.png
left-qr.jpg

扫一扫,领取大礼包

0

分享
qr-url?url=https%3A%2F%2Fblog.51cto.com%2Fxmuxsp%2F74801
xmuxsp
noavatar_middle.gif