Je suis actuellement en pleine prise en main de powershell, je commence donc doucement, avec des petits script faciles à réaliser, ci-dessous, vous en trouverez un permettant de créer des sites sous IIS8 de façon rapide & facile. Ce script powershell crée l’Application Pool, le site, le repertoire et un fichier index.html :
Write-Host "Welcome in PSWebsiteCreator by Alexnogard from alexnogard.com" -ForegroundColor Red -BackgroundColor White $SiteName = Read-Host "Please enter the site name" $PhysPath = Read-Host "Please enter path pointing to your website (e.g. : c:\mywebsite)" $BindingIP = Read-Host "Enter an Ip Address, or leave empty" $BindingPort = Read-Host "Enter port you wanna use (e.g. : 81) " $AppPool = Read-Host "You ApplicationPool Name (e.g. : Default Web Site)" s New-Item $PhysPath -type directory New-Item $PhysPath\index.html -type file -force -value "<center>Coucou petite perruche</center>" New-WebAppPool -Name $AppPool New-Website -Name $SiteName -ApplicationPool FirstWebsiteAppPool -Force -PhysicalPath $PhysPath -Port $BindingPort
A bientôt ;)