Skip to content

Instantly share code, notes, and snippets.

@jeffpatton1971
Last active January 1, 2016 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffpatton1971/8184361 to your computer and use it in GitHub Desktop.
Save jeffpatton1971/8184361 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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