Installation, Storage, and Compute with Windows Server 2016 — Question 144

Your network contains an Active Directory domain. The domain contains two servers named Server1 and Server2.
On Server1, you create a PowerShell Desired State Configuration (DSC) script stored in a file named Config.ps1.
You need to compile Config.ps1 so that the script can be applied to Server2 by using PowerShell DSC.
What should you run?

Answer options

Correct answer: A

Explanation

The correct command to compile a PowerShell DSC script is mofcomp.exe, which converts the script into a Managed Object Format (MOF) file that can be applied to the target node. The other options, such as Start-DscConfiguration and Publish-DscConfiguration, are used for applying configurations but do not compile the script itself. Running config.ps1 is simply executing the script and does not compile it.