Created
September 19, 2014 21:52
-
-
Save mwrock/9e2b251171268ffccbb5 to your computer and use it in GitHub Desktop.
Install Nuget Aerver
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
| try { | |
| cinst DotNet4.5 | |
| #Enable Web Services | |
| cinst IIS-WebServerRole -source WindowsFeatures | |
| cinst IIS-ISAPIFilter -source WindowsFeatures | |
| cinst IIS-ISAPIExtensions -source WindowsFeatures | |
| #Enable ASP.NET on win 2012/8 | |
| cinst IIS-NetFxExtensibility45 -source WindowsFeatures | |
| cinst NetFx4Extended-ASPNET45 -source WindowsFeatures | |
| cinst IIS-ASPNet45 -source WindowsFeatures | |
| #Enable ASP.NET on win 7/2008R2 | |
| ."$env:windir\microsoft.net\framework\v4.0.30319\aspnet_regiis.exe" -i | |
| #clean and create application | |
| Remove-Item c:\web\NugetServer -Recurse -Force -ErrorAction SilentlyContinue | |
| Mkdir c:\web\NugetServer -ErrorAction SilentlyContinue | |
| Copy-Item "$(Join-Path (Get-PackageRoot $MyInvocation ) NugetServer)\*" c:\web\NugetServer -Recurse -Force | |
| Import-Module WebAdministration | |
| Remove-WebSite -Name "Default Web Site" -ErrorAction SilentlyContinue | |
| Remove-WebSite -Name NugetServer -ErrorAction SilentlyContinue | |
| New-WebSite -ID 1 -Name NugetServer -Port 80 -PhysicalPath c:\web\NugetServer -Force | |
| #Client SKUs need to enable firewall | |
| netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80 | |
| Write-ChocolateySuccess 'NugetServer' | |
| } catch { | |
| Write-ChocolateyFailure 'NugetServer' $($_.Exception.ToString()) | |
| throw | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment