Skip to content

Instantly share code, notes, and snippets.

@JeremyMorgan
Created October 1, 2018 02:59
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save JeremyMorgan/5f5ca70db82bd645d891c1aedd4e1d2b to your computer and use it in GitHub Desktop.
Quick batch file to install IIS if it's not installed
@ECHO OFF
dism /online /get-featureinfo /featurename:IIS-WebServer | find "State : Disabled" > nul
if %ERRORLEVEL% == 0 (
echo "IIS Web Server is not installed"
dism /online /enable-feature /featurename:IIS-WebServer /all
)
dism /online /get-featureinfo /featurename:IIS-WebServer | find "State"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment