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

The what

The DSC Domain Specific Language (DSL) defines a standardized way of describing the expected configuration of a target system, whether that is one system or several thousand systems. It describes the what of the target node.

A DSL is a specialized set of language extensions and grammar that makes it easier to codify a specific set of problems. On the other hand, a product such as PowerShell is a general-purpose language, DSLs are specifically built to address a specific set of problems.

You may wonder why we are bothering to define and discuss DSL here. You may think it's an advanced topic or something only developers need to know, but you would be incorrect to discount it. DSLs are all around you, and you use them every day. For example, HTML is a human-readable DSL for web browsers to display content. The actual content is binary, but the HTML specification allows humans to write in a language they understand yet also have the computer understand it.

In the case of DSC, the DSL is oriented at expressing all the different ways in which you can describe the expected state of a system in an easy-to-read manner. If you can read PowerShell code, then the DSC DSL is no different than reading a function declaration with a set of parameters. Most importantly, this easy-to-read structure for you is also easy for the DSC parser to read and turn into an MOF file. This abstraction of an abstraction allows you to write configurations in a language you understand and for that to be translated into a language the system understands.

For example, the target system should have a list of software installed, several settings modified, some services that should be enabled and started, some users to be created and then added to a local group, and several files to be created and have content added to them. It reads like a grocery list to you, but the computer can understand and execute it the same way every time it runs.

主站蜘蛛池模板: 宣威市| 满洲里市| 东海县| 聂拉木县| 华宁县| 叙永县| 兴宁市| 隆安县| 巫山县| 琼结县| 东莞市| 凤山县| 德兴市| 喀喇沁旗| 普洱| 巧家县| 宜州市| 四子王旗| 乳源| 彩票| 瑞昌市| 包头市| 尼玛县| 霞浦县| 靖远县| 铜梁县| 慈溪市| 江安县| 大厂| 邛崃市| 金塔县| 河津市| 明溪县| 新丰县| 宜春市| 宁明县| 邯郸市| 鹰潭市| 鱼台县| 通海县| 呼图壁县|