Last active
January 22, 2024 05:39
-
-
Save frankfuu/9494e83912db0009f8b82ef0f5f0285a to your computer and use it in GitHub Desktop.
Sets up git, repo, iis, hostfiles and visual studio 2019
This file contains 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
## Usage ## | |
# replace frankfu and xxxx with bitbucket username and pat token | |
# Measure-Command { iwr https://gist.githubusercontent.com/frankfuu/9494e83912db0009f8b82ef0f5f0285a/raw/bootstrapinvestsmart.ps1 -OutFile bootstrap.ps1; Set-ExecutionPolicy Bypass -Force; ./bootstrap.ps1 -cloneUrl "https://frankfu:xxxxxxx@bitbucket.org/investsmart/investsmart.git" | Out-Default} | |
## Descrription ## | |
# Installs visual studio, setups iis, clones investsmart repo, setups certificates, hosts files, iis websites and app pools and does a build | |
# Tested working 17/06/2020 and takes roughly 15mins on my St. Leonards internet connection with a VM running with 6 cores and 8gb ram takes about 13 minutes. | |
param([string]$cloneUrl) | |
# Install chocolatey | |
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); | |
choco feature enable -n allowGlobalConfirmation | |
choco install visualstudio2022community --package-parameters "--passive --add Microsoft.VisualStudio.Workload.NetWeb --includeRecommended --includeOptional --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.NetCore.Component.Runtime.3.1" | |
#choco install visualstudio2019enterprise --package-parameters "--passive --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.Net.Component.4.7.1.TargetingPack --add Microsoft.Net.Component.4.TargetingPack" | |
# view more options here - https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2022 | |
# Setup IIS | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServer -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-CommonHttpFeatures -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpErrors -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpRedirect -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationDevelopment -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-NetFxExtensibility45 -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HealthAndDiagnostics -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpLogging -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-LoggingLibraries -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-RequestMonitor -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpTracing -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Security -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-RequestFiltering -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Performance -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerManagementTools -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-IIS6ManagementCompatibility -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-Metabase -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ManagementConsole -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-BasicAuthentication -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WindowsAuthentication -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-StaticContent -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-DefaultDocument -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebSockets -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-NetFxExtensibility45 -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45 -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIExtensions -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIFilter -All -norestart | |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpCompressionStatic -All -norestart | |
# Setup other dependencies | |
choco install urlrewrite; | |
choco install nuget.commandline; | |
choco install nodejs-lts --version=20.11.0 --force ; | |
choco install yarn git; | |
# Refresh path variables so we can use things like Nuget and Git | |
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | |
mkdir c:\projects; cd $$ | |
cd C:\projects\ | |
git clone $cloneUrl | |
cd .\investsmart\setup\ | |
.\setup.ps1 | |
cd .. | |
.\build.ps1 -buildNodePackages $true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment