Question 161 of 296 from exam AZ-400: Designing and Implementing Microsoft DevOps Solutions

Question 161 of 296 from exam AZ-400: Designing and Implementing Microsoft DevOps Solutions

Question

HOTSPOT -

You plan to use Desired State Configuration (DSC) to maintain the configuration state of virtual machines that run Windows Server.

You need to perform the following:

-> Install Internet Information Services (IIS) on the virtual machines.

-> Update the default home page of the IIS web server.

How should you configure the DSC configuration file? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Explanations

Box 1: WindowsFeature -

Example:

Configuration WebsiteTest {

# Import the module that contains the resources we're using.

Import-DscResource -ModuleName PsDesiredStateConfiguration

# The Node statement specifies which targets this configuration will be applied to.

Node 'localhost' {

# The first resource block ensures that the Web-Server (IIS) feature is enabled.

WindowsFeature WebServer {

Ensure = "Present"

Name = "Web-Server"

}

Box 2: File -

Example continued:

# The second resource block ensures that the website content copied to the website root folder.

File WebsiteContent {

Ensure = 'Present'

SourcePath = 'c:\test\index.htm'

DestinationPath = 'c:\inetpub\wwwroot'

}

https://docs.microsoft.com/en-us/powershell/scripting/dsc/quickstarts/website-quickstart