exam questions

Exam 70-740 All Questions

View all questions & answers for the 70-740 exam

Exam 70-740 topic 1 question 276 discussion

Actual exam question from Microsoft's 70-740
Question #: 276
Topic #: 1
[All 70-740 Questions]

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?

  • A. mofcomp.exe
  • B. Start-DscConfiguration
  • C. Publish-DscConfiguration
  • D. config.ps1
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
References:
https://docs.microsoft.com/en-us/windows/win32/wmisdk/compiling-mof-files https://docs.microsoft.com/en-us/powershell/dsc/configurations/configurations

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
pekalyok
Highly Voted 5 years, 7 months ago
The question is - you need to compile Config.ps1 so that the script can be applied to Server2 by using PowerShell DSC. - according the links provided https://docs.microsoft.com/en-us/windows/win32/wmisdk/compiling-mof-files%20 once we read through there is a link to a usage in cli for mofcomp.exe https://docs.microsoft.com/en-us/windows/win32/wmisdk/running-the-mof-compiler-on-a-file
upvoted 6 times
lbs
5 years, 1 month ago
I agree with answer A
upvoted 2 times
...
...
jam7272
Most Recent 4 years, 10 months ago
It's D - when you run the ps1 file it gets gobbled up and spat out as a MOF... poor thing
upvoted 1 times
...
TA77
4 years, 11 months ago
Correct answer is D, because we have a .ps1 file ans we need to generate a .mof file to apply it to server 2. So, all we have to do is run config.ps1 to generate the .mof file. mofcomp.exe tool, only works on .mof files. See the highlighted text in the link below: https://docs.microsoft.com/en-us/windows/win32/wmisdk/mofcomp#:~:text=but%20you%20can%20also%20compile%20MOF%20files%20by%20using%20this%20tool.
upvoted 2 times
...
LeonSKanady
5 years, 1 month ago
If you want to pick D (config.ps1).... it should start with (. <space> config.ps1) or ( Dot Space confiig.ps1) but the D option of question does not have any (Dot Space).. So answer should be A (mofcomp.exe) Ref: https://docs.microsoft.com/en-us/powershell/scripting/dsc/configurations/write-compile-apply-configuration?view=powershell-6
upvoted 2 times
...
LeonSKanady
5 years, 1 month ago
If you want to pick D (config.ps1).... it should start with (. <space> config.ps1) or ( Dot Space confiig.ps1) but the D option of question does not have any (Dot Space) Ref: https://docs.microsoft.com/en-us/powershell/scripting/dsc/configurations/write-compile-apply-configuration?view=powershell-6
upvoted 2 times
VeiN
4 years, 12 months ago
Nope, the dot is one of the methods to run the ps1 files. The question is "what to run", not how. So it`s D, because you need to run the script and it will compile a mof file.
upvoted 3 times
...
...
SmithJohnson
5 years, 3 months ago
It's not D because it's missing the dot, space. You can't count the one after the D because all the answer choices have that format
upvoted 3 times
...
user200
5 years, 5 months ago
Answer: D mvdb87 is correct, look at this URL https://docs.microsoft.com/en-us/windows/win32/wmisdk/mofcomp it states: The Managed Object Format (MOF) compiler parses a file *CONTAINING MOF statements and adds the classes and class instances defined in the file to the WMI repository..........so you need a mof file already created to use this command.
upvoted 2 times
...
mvdb87
5 years, 5 months ago
It's D. The .mof file will be generated after dot sourcing the script, so you'll have to use the config.ps1 first. The Start-DscConfiguration command is used AFTER compiling. Source: https://docs.microsoft.com/en-us/powershell/scripting/dsc/configurations/write-compile-apply-configuration?view=powershell-6 Compile the configuration For a DSC configuration to be applied to a node, it must first be compiled into a MOF file. Running the configuration, like a function, will compile one ".mof" file for every Node defined by the Node block. In order to run the configuration, you need to dot source your "HelloWorld.ps1" script into the current scope. For more information, see about_Scripts. Dot source your "HelloWorld.ps1" script by typing in the path where you stored it, after the . (dot, space). You may then, run your configuration by calling it like a Function.
upvoted 1 times
...
Gary
5 years, 7 months ago
Hi guys: See below link: https://docs.microsoft.com/en-us/powershell/scripting/dsc/configurations/write-compile-apply-configuration?view=powershell-6 According to what I did in my lab before, just “ . .config.ps1” can generate the mof file we need. Because you define the node in ps1 node block. Thanks.
upvoted 2 times
...
Gary
5 years, 7 months ago
how about D?
upvoted 2 times
uevenasdf
5 years, 3 months ago
What about it? You need to compile the script not run it therefore answer is A
upvoted 4 times
...
...
RicardoRyuma
5 years, 7 months ago
I think is Start-DscConfiguration
upvoted 1 times
TA77
4 years, 11 months ago
No that's wrong. First you need to compile your configuration file to generate .mof for every node, after that you can push the .mof files using Start-DscConfiguration
upvoted 3 times
...
...
RicardoRyuma
5 years, 7 months ago
I did not find any references to mofcomp.exe for the use in question.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...