Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script to configure webbox
# Connect to web-box
Enter-PsSession -ComputerName -Credential "WS0114\Administrator"
# Prepare dependencies
Import-Module ServerManager
Import-Module WebAdministration
Import-Module BitsTransfer
# Install IIS
Add-WindowsFeature Web-Server
# Setup .NET 4.0
Start-Process .\dotNetFx40_Full_x86_x64.exe -ArgumentList "/q /norestart" -Wait
# Set IIS to user .NET 4.0 by default
Set-WebConfigurationProperty /system.applicationHost/applicationPools/applicationPoolDefaults -name managedRuntimeVersion -value v4.0
# Lets create example site
New-Item "C:\inetpub\example" -ItemType Directory
New-WebSite Example -Port:8080 -PhysicalPath:"C:\inetpub\example"
Get-Url -ToFile "C:\inetpub\example\index.html"
Get-Url localhost:8080/
# Bye!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment