Hi @Efff dd,
The following code is an example of a DSC configuration script, which contains the property definition of the website, you can refer to it:
Configuration WebsiteConfig
{
Import-DscResource -ModuleName PSDesiredStateConfiguration
Node localhost
{
WindowsFeature IIS
{
Ensure = "Present"
Name = "Web-Server"
}
WindowsFeature ASPNET45
{
Ensure = "Present"
Name = "Web-Asp-Net45"
}
xWebsite Site
{
Ensure = "Present"
Name = "example"
State = "Started"
PhysicalPath = "C:\inetpub\wwwroot\example"
BindingInfo = MSFT_xWebBindingInformation
{
Protocol = "http"
Port = "80"
IPAddress = "*"
HostName = "example.abc.com"
}
MimeMap = @(
@{
Extension = ".htm"
MimeType = "text/html"
},
@{
Extension = ".xml"
MimeType = "text/xml"
}
)
ApplicationPool = "exampleAppPool"
}
xWebAppPool exampleAppPool
{
Ensure = "Present"
Name = "exampleAppPool"
ManagedRuntimeVersion = "v4.0"
ManagedPipelineMode = "Integrated"
}
}
}
WebsiteConfig -OutputPath "C:\DSC\Configs"
This code defines a website named "example", uses the application pool "exampleAppPool", and adds two MIME type mappings here.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the email notification for this thread. Best regards, Yurong Dai