官术网_书友最值得收藏!

PowerShell scripting templates

As you develop different scripts for your enterprise environment, you will have a core set of functions that you tend to use in all of your scripts. Some enterprise scripters create their own functions, while others leverage scripts from the vast community of PowerShell developers. With either method, you will need a solid foundation to build your scripts on.

Some of the most common items this book provides for scripting templates include:

  • Encryption and decryption technologies: Probably the most common requirement in enterprise environments is security. It's no secret that you should not have clear text administrative-level credentials in scripts. Providing an encryption and decryption function in your scripts is essential to maintaining a secure enterprise.
  • Logging mechanisms: The second most common requirement in enterprise environments is logging script actions. Since scripts are typically executed on a large number of systems at the same time, you will need the ability to track exactly what is being performed on these systems. Creating a logging function will provide the ability to log script actions to both the event log and a log file.
  • Answer file logic: One of the more advanced methods for PowerShell scripting is leveraging an answer file for script variables. The core to the answer file is that you can add, remove, and modify the values in the answer file without having to modify your script. This provides the ability to have flexibility in your scripts without needing to touch any lines of code.
  • Standardized comment blocks: When you are creating scripts, it's essential to give yourself and others reminders of what the script's function is. Comment blocks enable the ability to provide details about the script, revision history, and execution parameters of the script.

Whether you are new to PowerShell scripting or you have been scripting for a long time, this book provides thought-inspiring methods to improve your scripting abilities. As you work through this book, it's strongly encouraged to incorporate these examples in your own scripts. This applied learning methodology will significantly help in your retention of the content, and provide a very robust enterprise scripting platform.

主站蜘蛛池模板: 凤城市| 西畴县| 呼伦贝尔市| 明光市| 宣城市| 阳曲县| 天水市| 甘孜| 叶城县| 股票| 竹溪县| 伊金霍洛旗| 万宁市| 襄樊市| 贵德县| 兖州市| 永胜县| 闵行区| 昌都县| 孝义市| 漳州市| 娄底市| 拉孜县| 织金县| 海林市| 屏山县| 五指山市| 察雅县| 仁化县| 清流县| 将乐县| 闵行区| 华亭县| 苗栗市| 甘肃省| 菏泽市| 即墨市| 高碑店市| 沙湾县| 金堂县| 汉源县|