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:
- Create your script based on the template 基于模板创建你的脚本
- Place the script in the folder \Distribution\Scripts 把脚本放在\Distribution\Scripts
- Create an Application in the BDD Workbench that references this script 创建一个和脚本有关的应用程序
- Add the Application to the build task sequence把程序添加到ts中
It is also important to remember the following key rules when creating your script:
- Always declare variables 记得声明你的变量
- Only create objects where required - BDD creates most objects you will need需要时才创建对象
- Check if ZTIUtitlity provides the functionality you require before writing a function在写一个函数前先看看ZTIUtility是否提供了你需要的
- 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
收藏
推荐专栏更多
猜你喜欢
我的友情链接
Visual Studio 2010更改颜色背景的方法
Java线程:线程的调度-休眠
我们不得不面对的中年职场危机
职场终极密籍--记我的职业生涯
用光影魔术手制作一寸照片(8张一寸)
我的IT职场生涯: 毕业4年,月薪过万
Linux关闭休眠和屏保模式
年薪从0到10万-我的IT职场经验总结
Windows7删除休眠文件hiberfil.sys节省大量C盘空间
致IT同仁 — IT人士常犯的17个职场错误
“跳槽加薪”现象,无奈的职场规则
API网关如何实现对服务下线实时感知
浅谈ACL(访问控制列表)
Confluence 未授权 RCE (CVE-2019-3396) 漏洞分析
亿级日搜索量的美团如何构建高效的搜索系统?
玩转KVM:怎么追查KVM故障
mysql5.7.25主从同步图解(主:CentOS7.5,从win10)
springboot2+exporter+prometheus+grafana搭建监控体系
使用Alpine Linux和Oracle jre6构建Tomcat6镜像及应用容器化
![f92360e227f9d91cdff7ea95120630ef.png](https://s1.51cto.com/images/blog/201905/05/f92360e227f9d91cdff7ea95120630ef.png)
![left-qr.jpg](https://static1.51cto.com/edu/blog/mobile/images/left-qr.jpg)
扫一扫,领取大礼包
转载于:https://blog.51cto.com/xmuxsp/74801
Ctrl+Enter 发布
发布
取消