Last active
August 2, 2019 18:54
-
-
Save jetstreamin/34ace3511271b9604325036cf6d4ea07 to your computer and use it in GitHub Desktop.
Created with Copy to Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #https://github.com/aspnet/Tooling/blob/AspNetVMs/docs/create-asp-net-vm-with-webdeploy.md | |
| # Install IIS (with Management Console) | |
| Install-WindowsFeature -name Web-Server -IncludeManagementTools | |
| # Install ASP.NET 4.6 | |
| Install-WindowsFeature Web-Asp-Net45 | |
| # Install Web Management Service | |
| Install-WindowsFeature -Name Web-Mgmt-Service | |
| # Install Web Deploy 3.6 | |
| # Download file from Microsoft Downloads and save to local temp file (%LocalAppData%/Temp/2) | |
| $msiFile = [System.IO.Path]::GetTempFileName() | Rename-Item -NewName { $_ -replace 'tmp$', 'msi' } -PassThru | |
| Invoke-WebRequest -Uri http://download.microsoft.com/download/0/1/D/01DC28EA-638C-4A22-A57B-4CEF97755C6C/WebDeploy_amd64_en-US.msi -OutFile $msiFile | |
| # Prepare a log file | |
| $logFile = [System.IO.Path]::GetTempFileName() | |
| # Prepare the arguments to execute the MSI | |
| $arguments= '/i ' + $msiFile + ' ADDLOCAL=ALL /qn /norestart LicenseAccepted="0" /lv ' + $logFile | |
| # Execute the MSI and wait for it to complete | |
| $proc = (Start-Process -file msiexec -arg $arguments -Passthru) | |
| $proc | Wait-Process | |
| Get-Content $logFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment