C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
PowerShell DSCThe Desired State Configuration (DSC) is a management platform in a PowerShell that is used for development, configuration, and management of systems. PowerShell DSC was introduced in version 4.0. So, if you want to use it, you need a version 4.0 or above of PowerShell. It is available on Linux, Windows, and Nano Server. It provides a collection of PowerShell language extensions, cmdlets, and a process called declarative scripting. It mainly consists of three components:
DSC ConfigurationsDSC Configurations are the scripts of PowerShell, which define a special type of function. We use the keyword Configuration to define the configuration. Syntax of DSC Configuration The configuration script consists of the following parts:
Example: In this example, we can specify the name of the node by passing the parameter computerName when we compile the configuration. Configuration MyDscConfiguration { Param ( [string[]]$ComputerName='localhost' ) Node $ComputerName { WindowsFeature MyFeatureInstance { Ensure = 'Present' Name = 'RSAT' } WindowsFeature My2ndFeatureInstance { Ensure = 'Present' Name = 'Bitlocker' } Type the following command to get the output of above example: MyDscConfiguration Output: Directory: C:\MyDscConfiguration Mode LastWrite Time Length Name ---- ------------- ------ --- -a---- 18-11-2019 16:16 2554 localhost.mof DSC ResourcesThe resources of desired state configuration provide the building blocks for the DSC configuration. The following are the basic built-in configuration resources of the Desired State Configuration:
DSC Local Configuration Manager (LCM)It is an engine of Desired State Configuration. The Local Configuration Manager is responsible for enacting and parsing configurations which are sent to the node. It controls all the executions of the DSC configurations.
Next TopicPowerShell Get-Date Format
|