Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Desired State Configuration for a basic web server
Configuration BasicWebServer
{
param
(
[string]$ComputerName
)
Node $ComputerName
{
WindowsFeature WebServerRole
{
# Installs the following features
<#
Web-Server
Web-WebServer
Web-Common-Http
Web-Default-Doc
Web-Dir-Browsing
Web-Http-Errors
Web-Static-Content
Web-Health
Web-Http-Logging
Web-Performance
Web-Stat-Compression
Web-Security
Web-Filtering
#>
Name = "Web-Server"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
WindowsFeature WebAppDev
{
Name = "Web-App-Dev"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
WindowsFeature WebAspNet
{
Name = "Web-Asp-Net"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
WindowsFeature WebNetExt
{
Name = "Web-Net-Ext"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
WindowsFeature WebISAPIExt
{
Name = "Web-ISAPI-Ext"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
WindowsFeature WebISAPIFilter
{
Name = "Web-ISAPI-Filter"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
WindowsFeature WebLogLibraries
{
Name = "Web-Log-Libraries"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
WindowsFeature WebRequestMonitor
{
Name = "Web-Request-Monitor"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
WindowsFeature WebMgmtTools
{
Name = "Web-Mgmt-Tools"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
WindowsFeature WebMgmtConsole
{
Name = "Web-Mgmt-Console"
Ensure = "Present"
Source = "C:\Windows\SxS"
}
}
}
@jeffpatton1971

This comment has been minimized.

Copy link
Owner Author

jeffpatton1971 commented Dec 30, 2013

You will need to remember to Enable-PSRemoting before you run this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.