Skip to content

Instantly share code, notes, and snippets.

@wickdninja
Forked from flcdrg/boxstarter-bare-v3.ps1
Created June 20, 2020 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wickdninja/0ce3c972ddc6e7bd869bb98852f0aed5 to your computer and use it in GitHub Desktop.
Save wickdninja/0ce3c972ddc6e7bd869bb98852f0aed5 to your computer and use it in GitHub Desktop.
My BoxStarter Scripts
# SQL Server - do this early to avoid issues with newer versions of VC++ 2015 redist
choco install sql-server-2017
choco install sql-server-2017-cumulative-update
choco install sql-server-management-studio
# tools
choco install git
choco install nodejs
choco install tortoisegit
choco install vscode
choco pin add -n=vscode
choco install yarn
choco install 7zip
# .NET
choco install dotnet4.5
choco install dotnet4.6
choco install dotnet4.6.1
choco install dotnet4.6.2
choco install dotnet4.7
choco install dotnet4.7.1
choco install dotnetcore-sdk
choco install netfx-4.5.1-devpack
choco install netfx-4.5.2-devpack
choco install netfx-4.6.1-devpack
choco install netfx-4.7-devpack
choco install netfx-4.7.1-devpack
# Visual Studio 2017
choco install visualstudio2017professional
choco install visualstudio2017-workload-manageddesktop
choco install visualstudio2017-workload-netcoretools
choco install visualstudio2017-workload-netweb
choco install visualstudio2017-workload-node
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned -Force
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory $directory | Out-Null
}
"# Profile" > $PROFILE
}
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n=allowGlobalConfirmation
choco feature enable -n=useRememberedArgumentsForUpgrades
# Copy chocolatey.license.xml to C:\ProgramData\chocolatey\license
choco install chocolatey.extension
choco install boxstarter
#>
# 2. Run with this:
<#
$cred=Get-Credential domain\username
Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/flcdrg/87802af4c92527eb8a30/raw/boxstarter-bare.ps1 -Credential $cred
#>
# https://github.com/mwrock/boxstarter/issues/241#issuecomment-336028348
New-Item -Path "c:\temp" -ItemType directory -Force | Out-Null
Update-ExecutionPolicy RemoteSigned
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableExpandToOpenFolder
# No SMB1 - https://blogs.technet.microsoft.com/filecab/2016/09/16/stop-using-smb1/
Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol
Enable-RemoteDesktop
# NuGet package provider. Do this early as reboots are required
if (-not (Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue)) {
Write-Host "Install-PackageProvider"
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
# Exit equivalent
Invoke-Reboot
}
# Install initial version of PowerShellGet
if (-not (Get-InstalledModule -Name PowerShellGet -ErrorAction SilentlyContinue)) {
Write-Host "Install-Module PowerShellGet"
Install-Module -Name "PowerShellGet" -AllowClobber -Force
# Exit equivalent
Invoke-Reboot
}
# Upgrade to latest version (> 2.2)
if (Get-InstalledModule -Name PowerShellGet | Where-Object { $_.Version -le 2.2 } ) {
#Write-Host "Update-Module PowerShellGet"
# Unload this first to avoid
#Write-Host "Removing in-use modules"
#Remove-Module PowerShellGet -Force
#Remove-Module PackageManagement -Force
# This fails due to "module 'PackageManagement' is currently in use" error. Don't think there's a way around this.
#PowerShellGet\Update-Module -Name PowerShellGet -Force
# Exit equivalent
#Invoke-Reboot
}
# Write-Host "Set-PSRepository"
# Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -Force
# Windows features
choco install NetFx3 TelnetClient Microsoft-Hyper-V-All IIS-WebServerRole IIS-NetFxExtensibility45 IIS-HttpCompressionDynamic IIS-WindowsAuthentication IIS-ASPNET45 IIS-IIS6ManagementCompatibility Containers -source windowsfeatures --cacheLocation="c:\temp"
# Remove unwanted Store apps
Get-AppxPackage Facebook.Facebook | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage TuneIn.TuneInRadio | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage Microsoft.MinecraftUWP | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage Microsoft.MicrosoftSolitaireCollection | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage KeeperSecurityInc.Keeper | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage 2FE3CB00.PicsArt-PhotoStudio | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage 9E2F88E3.Twitter | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name *Twitter | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name *MarchofEmpires | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name king.com.* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.3DBuilder | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name *Bing* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.Office.Word | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.Office.PowerPoint | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.Office.Excel | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.MicrosoftOfficeHub | Remove-AppxPackage -ErrorAction SilentlyContinue
Write-Host "Temp: $($env:temp)"
# .NET
choco install dotnet4.5 --cacheLocation="c:\temp"
choco install dotnet4.6 --cacheLocation="c:\temp"
choco install dotnet4.6.1 --cacheLocation="c:\temp"
choco install dotnet4.6.2 --cacheLocation="c:\temp"
choco install dotnet4.7 --cacheLocation="c:\temp"
choco install dotnet4.7.1 --cacheLocation="c:\temp"
choco install dotnetfx --version 4.7.2.20180712 -m --cacheLocation="c:\temp"
choco install dotnetfx --version --version 4.8.0.0-rtw2 --pre -m --cacheLocation="c:\temp"
choco install netfx-4.5.1-devpack --cacheLocation="c:\temp"
choco install netfx-4.5.2-devpack --cacheLocation="c:\temp"
choco install netfx-4.6.1-devpack --cacheLocation="c:\temp"
choco install netfx-4.7-devpack --cacheLocation="c:\temp"
choco install netfx-4.7.1-devpack --cacheLocation="c:\temp"
choco install netfx-4.7.2-devpack --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 1.1.14 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 2.1.105 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 2.1.202 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 2.1.302 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 2.1.403 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 2.1.508 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 2.1.605 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 2.1.701 -m --cacheLocation="c:\temp" # 2.1 for VS2019
choco install dotnetcore-sdk --version 2.1.801 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 2.2.108 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 2.2.205 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 2.2.301 -m --cacheLocation="c:\temp" # 2.2 for VS2019
choco install dotnetcore-sdk --version 2.2.401 -m --cacheLocation="c:\temp"
choco install dotnetcore-sdk --version 3.0.103 -m --cacheLocation="c:\temp" # 3.0 for VS2019
choco install dotnetcore-sdk --version 3.1.101 -m --cacheLocation="c:\temp" # 3.0 for VS2019
choco pin add -n=dotnetcore-sdk # Pin to avoid upgrade uninstalling all these versions!
cinst firefox --cacheLocation="c:\temp"
choco pin add -n=firefox
#cinst GoogleChrome --cacheLocation="c:\temp"
#choco pin add -n=GoogleChrome
cinst 7zip --cacheLocation="c:\temp"
cinst azure-cli --cacheLocation="c:\temp"
cinst becyicongrabber --cacheLocation="c:\temp"
if ((get-wmiobject Win32_ComputerSystem).manufacturer -like "*Dell*") {
cinst dellcommandupdate-uwp --cacheLocation="c:\temp"
}
cinst FiraCode --cacheLocation="c:\temp" # font
cinst git --cacheLocation="c:\temp"
if ((get-wmiobject Win32_ComputerSystem).manufacturer -like "*Lenovo*") {
cinst lenovo-thinkvantage-system-update --cacheLocation="c:\temp"
}
cinst paint.net --cacheLocation="c:\temp"
cinst mousewithoutborders --cacheLocation="c:\temp"
choco install microsoft-edge --cacheLocation="c:\temp"
cinst msbuild-structured-log-viewer --cacheLocation="c:\temp"
cinst nodejs --cacheLocation="c:\temp"
cinst nuget.commandline --cacheLocation="c:\temp"
# cinst NugetPackageExplorer --cacheLocation="c:\temp" # Use Store version
choco install office365business --cacheLocation="c:\temp"
cinst PDFXchangeEditor --cacheLocation="c:\temp"
cinst pingplotter --cacheLocation="c:\temp"
cinst powershell-core --cacheLocation="c:\temp"
cinst procmon --cacheLocation="c:\temp"
cinst tailblazer --ignore-checksums --cacheLocation="c:\temp"
cinst tortoisegit --cacheLocation="c:\temp"
# cinst tortoisesvn --cacheLocation="c:\temp"
cinst vscode --cacheLocation="c:\temp"
choco pin add -n=visualstudiocode
cinst vswhere --cacheLocation="c:\temp"
cinst windirstat --cacheLocation="c:\temp"
cinst x-lite --cacheLocation="c:\temp"
cinst yarn --cacheLocation="c:\temp"
cinst zoomit --cacheLocation="c:\temp"
#cinst sql-server-management-studio --cacheLocation="c:\temp"
cinst azure-data-studio --cacheLocation="c:\temp"
# Visual Studio 2019
choco install visualstudio2019enterprise --cacheLocation="c:\temp"
choco install visualstudio2019-workload-visualstudioextension --cacheLocation="c:\temp"
choco install visualstudio2019-workload-manageddesktop --cacheLocation="c:\temp"
choco install visualstudio2019-workload-netweb --cacheLocation="c:\temp" # ASP.NET and web development
choco install visualstudio2019-workload-netcoretools --cacheLocation="c:\temp" # .NET Core cross-platform development
choco install visualstudio2019-workload-node --cacheLocation="c:\temp" #Node.js development
cinst resharper-ultimate-all --cacheLocation="c:\temp" --params "'/NoCpp /NoTeamCityAddin'"
# cinst ozcode-vs2017 --cacheLocation="c:\temp"
choco install docker-desktop --cacheLocation="c:\temp"
$docker = "C:\Program Files\Docker\Docker\Resources\bin\docker.exe"
# Assume by default Linux containers
#if (-not(& $docker info | Select-String -SimpleMatch linux)) {
# & 'c:\Program Files\docker\docker\dockercli.exe' -SwitchDaemon | Out-Null # Handle 'The operation has timed out
# Start-Sleep -Seconds 5
#}
# Docker for Linux is not working here. Not sure why.
# & docker version
# & $docker pull microsoft/dotnet
# & $docker pull microsoft/mssql-server-linu# & $docker pull microsoft/aspnetcore
# Switch to Windows
#& 'c:\Program Files\docker\docker\dockercli.exe' -SwitchDaemon
#& $docker pull microsoft/nanoserver
# & $docker pull microsoft/mssql-server-windows-developer
# & $docker pull microsoft/windowsservercore
# https://github.com/matt9ucci/DockerCompletion
Write-Host "DockerCompletion"
Install-Module DockerCompletion -Force
Install-Module posh-git -AllowPrerelease -Force
# Enable Developer Mode - not required now for WSL
#$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
#if (-not(Test-Path -Path $RegistryKeyPath)) {
# New-Item -Path $RegistryKeyPath -ItemType Directory -Force
#
# # Add registry value to enable Developer Mode
# New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1
#
# # Assume if we had to create that then we need to reboot.
# Invoke-Reboot
#}
# Enable Linux subsystem
cinst Microsoft-Windows-Subsystem-Linux -source windowsFeatures
# C:\windows\system32\inetsrv\appcmd.exe unlock config -section:windowsAuthentication
# C:\windows\system32\inetsrv\appcmd.exe unlock config -section:anonymousAuthentication
# Note: There are ususally VS Solution-specific config file in .vs\config\applicationhost.config too
# & "C:\Program Files\IIS Express\appcmd.exe" unlock config -section:windowsAuthentication
# & "C:\Program Files\IIS Express\appcmd.exe" unlock config -section:anonymousAuthentication
#PowerShell help
Update-Help -ErrorAction SilentlyContinue
# Install after other packages, so integration will work
cinst beyondcompare --cacheLocation="c:\temp"
cinst beyondcompare-integration --cacheLocation="c:\temp"
Install-WindowsUpdate -AcceptEula -GetUpdatesFromMS
Enable-UAC
# Run with START http://boxstarter.org/package/url?https://gist.githubusercontent.com/flcdrg/87802af4c92527eb8a30/raw/demo01.ps1
Update-ExecutionPolicy RemoteSigned
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableExpandToOpenFolder
Enable-RemoteDesktop
# Windows features
cinst TelnetClient -source windowsfeatures
# Reboot?
choco install powershell #KB2999226
# Chocolatey packages
#cinst beyondcompare
cinst zoomit
# Second demo script
<#
$cred=Get-Credential flcdrg
Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/flcdrg/87802af4c92527eb8a30/raw/demo02.ps1 -Credential $cred
#>
New-Item -Path "$env:userprofile\AppData\Local\ChocoCache" -ItemType directory -Force | Out-Null
$common = "--cacheLocation=`"$env:userprofile\AppData\Local\ChocoCache`""
choco install notepadplusplus $common
# https://github.com/mwrock/boxstarter/issues/241#issuecomment-336028348
New-Item -Path "$env:userprofile\AppData\Local\ChocoCache" -ItemType directory -Force | Out-Null
$common = "--cacheLocation=`"$env:userprofile\AppData\Local\ChocoCache`""
choco install bginfo-startup -pre -packageParameters '/RunImmediately' $common
choco install NetFx3 -source windowsfeatures
choco install dotnetcore-runtime $common
choco install dotnetcore-sdk --version=2.1.302 $common
choco install dotnetcore-sdk --version=2.1.403 $common
choco install git $common
choco install yarn $common
# .NET Framework
choco install dotnet4.5 $common
choco install dotnet4.6 $common
choco install dotnet4.6.1 $common
choco install dotnet4.6.2 $common
choco install dotnet4.7 $common
choco install dotnet4.7.1 $common
choco install dotnet4.7.2 $common
choco install dotnetcore-sdk $common
choco install netfx-4.5.1-devpack $common
choco install netfx-4.5.2-devpack $common
choco install netfx-4.6.1-devpack $common
choco install netfx-4.7-devpack $common
choco install netfx-4.7.1-devpack $common
choco install netfx-4.7.2-devpack $common
# Visual Studio
choco install visualstudio2017buildtools --params "'--add Microsoft.Net.Component.4.5.TargetingPack'" $common
choco pin add -n=visualstudio2017buildtools $common
choco install visualstudio2017-workload-manageddesktop $common
choco pin add -n="visualstudio2017-workload-manageddesktop" $common
choco install visualstudio2017-workload-netcoretools $common
choco pin add -n="visualstudio2017-workload-netcoretools" $common
choco install visualstudio2017-workload-netweb $common
choco pin add -n="visualstudio2017-workload-netweb" $common
choco install visualstudio2017-workload-node $common
choco pin add -n="visualstudio2017-workload-node" $common
# Stop MSBuild processes from hanging around
[Environment]::SetEnvironmentVariable("MSBUILDDISABLENODEREUSE", "1", "Machine")
New-Item -Path "c:\temp" -ItemType directory -Force | Out-Null
cinst audacity --cacheLocation="c:\temp"
cinst audacity-lame --cacheLocation="c:\temp" # also gets audacity too
cinst itunes --cacheLocation="c:\temp"
cinst javaruntime --cacheLocation="c:\temp"
cinst dropbox --cacheLocation="c:\temp"
choco pin add -n=dropbox
choco install rss-builder --cacheLocation="c:\temp"
cinst svn --cacheLocation="c:\temp"
cinst ubiquiti-unifi-controller --cacheLocation="c:\temp"
cinst keepass --cacheLocation="c:\temp"
choco pin add -n=GoogleChrome
choco pin add -n=azure-data-studio
choco pin add -n=docker-desktop
choco pin add -n=visualstudio2019enterprise
choco pin add -n=firefox
choco pin add -n=Office365Business
choco pin add -n=vscode
choco pin add -n="vscode.install"
choco pin add -n="dotnetcore-sdk"
choco pin add -n="microsoft-edge"
choco pin add -n="paint.net"
# Is x86 sticky?
cinst notepadplusplus --x86
cinst microsoft-teams
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory $directory | Out-Null
}
"# Profile" > $PROFILE
}
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n=allowGlobalConfirmation
choco install boxstarter
#>
# 2. Run with this:
<#
$cred=Get-Credential flcdrg
Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/flcdrg/87802af4c92527eb8a30/raw/simple-dev.ps1 -Credential $cred
#>
# https://github.com/mwrock/boxstarter/issues/241#issuecomment-336028348
New-Item -Path "$env:userprofile\AppData\Local\ChocoCache" -ItemType directory -Force | Out-Null
$common = "--cacheLocation=`"$env:userprofile\AppData\Local\ChocoCache`""
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableExpandToOpenFolder
# No SMB1 - https://blogs.technet.microsoft.com/filecab/2016/09/16/stop-using-smb1/
Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol
Enable-RemoteDesktop -DoNotRequireUserLevelAuthentication # Disable RULA For RDP to AzureAD connected PCs
# Windows features
Enable-WindowsOptionalFeature -Online -FeatureName NetFx3, TelnetClient,Microsoft-Hyper-V-All
choco install IIS-WebServerRole IIS-NetFxExtensibility45 IIS-HttpCompressionDynamic IIS-WindowsAuthentication IIS-ASPNET45 IIS-IIS6ManagementCompatibility -source windowsfeatures $common
choco install Containers -source windowsfeatures $common
# SQL Server - do this early to avoid issues with newer versions of VC++ 2015 redist
# Because dependencies call Install-WindowsUpdate, this will force a full Windows Update check.
choco install sql-server-2017 $common
choco install sql-server-2017-cumulative-update --version 14.0.3029.16 $common
choco install sql-server-management-studio $common
choco install powershell $common
cinst GoogleChrome $common
choco pin add -n=GoogleChrome $common
cinst firefox $common
choco pin add -n=firefox $common
cinst FiraCode $common # font
cinst git $common
cinst keepass $common
cinst keepass-plugin-favicon $common
cinst microsoft-teams.install $common
choco pin add -n="microsoft-teams.install" $common
cinst nodejs $common
cinst notepadplusplus $common
cinst NugetPackageExplorer $common
cinst PDFXchangeEditor $common
cinst python2 $common
cinst skype $common
cinst tailblazer $common --ignore-checksums
cinst tortoisegit $common
cinst tortoisesvn $common
cinst visualstudiocode $common
choco pin add -n=visualstudiocode $common
cinst windirstat $common
cinst zoomit $common
cinst yarn $common
cinst 7zip $common
# Visual Studio 2017
choco install dotnet4.5 $common
choco install dotnet4.6 $common
choco install dotnet4.6.1 $common
choco install dotnet4.6.2 $common
choco install dotnet4.7 $common
choco install dotnet4.7.1 $common
choco install dotnet4.7.2 $common
choco install dotnetcore-sdk $common
choco install netfx-4.5.1-devpack $common
choco install netfx-4.5.2-devpack $common
choco install netfx-4.6.1-devpack $common
choco install netfx-4.7-devpack $common
choco install netfx-4.7.1-devpack $common
choco install netfx-4.7.2-devpack $common
choco install visualstudio2017professional $common
choco pin add -n="visualstudio2017professional" $common
choco install visualstudio2017-workload-manageddesktop $common
choco pin add -n="visualstudio2017-workload-manageddesktop" $common
choco install visualstudio2017-workload-netcoretools $common
choco pin add -n="visualstudio2017-workload-netcoretools" $common
choco install visualstudio2017-workload-netweb $common
choco pin add -n="visualstudio2017-workload-netweb" $common
choco install visualstudio2017-workload-node $common
choco pin add -n="visualstudio2017-workload-node" $common
Write-BoxstarterMessage "NuGet package provider"
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
PowerShellGet\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force
Write-BoxstarterMessage "Enable Developer Mode"
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
if (-not(Test-Path -Path $RegistryKeyPath)) {
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
# Add registry value to enable Developer Mode
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1
# Assume if we had to create that then we need to reboot.
$Boxstarter.RebootOk = $true
Invoke-Reboot
}
# Enable Linux subsystem (requires developer mode enabled)
choco install Microsoft-Windows-Subsystem-Linux -source windowsFeatures $common
C:\windows\system32\inetsrv\appcmd.exe unlock config -section:windowsAuthentication
C:\windows\system32\inetsrv\appcmd.exe unlock config -section:anonymousAuthentication
# Note: There are ususally VS Solution-specific config file in .vs\config\applicationhost.config too
& "C:\Program Files\IIS Express\appcmd.exe" unlock config -section:windowsAuthentication
& "C:\Program Files\IIS Express\appcmd.exe" unlock config -section:anonymousAuthentication
#PowerShell help
Update-Help -ErrorAction SilentlyContinue
# Install after other packages
cinst beyondcompare $common
cinst beyondcompare-integration $common
Install-WindowsUpdate -AcceptEula -GetUpdatesFromMS
Enable-UAC
# Troublesome packages
# cinst paint.net $common
# [Environment]::SetEnvironmentVariable("TeamCityServerUrl", "http://teamcity:8111", "machine")
# [Environment]::SetEnvironmentVariable("BOXSTARTER_NO_VS", "1", "machine")
# [Environment]::SetEnvironmentVariable("TeamCityServiceAccount", "ServiceAccount", "machine")
# [Environment]::SetEnvironmentVariable("TeamCityServiceAccountPassword", "Password", "machine")
$installVisualStudio = (-not (Test-Path env:BOXSTARTER_NO_VS))
Update-ExecutionPolicy RemoteSigned
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableExpandToOpenFolder
Enable-UAC
cinst powershell
cinst 7zip
cinst bginfo
cinst bginfo-startup -pre -packageParameters '/RunImmediately'
cinst notepadplusplus
cinst server-jre
cinst windirstat
if ($installVisualStudio) {
cinst windbg # Required for symbol server support
}
# cinst msbuild.communitytasks
cinst tailblazer
# Install external Chocolatey (https://groups.google.com/forum/#!searchin/boxstarter/install$20chocolatey/boxstarter/9Y0EEDJ8I3I/-0gsGurxMAAJ)
if (-not (Test-Path c:\ProgramData\chocolatey\bin\choco.exe))
{
iwr https://chocolatey.org/install.ps1 | iex
}
# Make bginfo run on startup/login
if (-not (Test-Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\bginfo.lnk"))
{
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\bginfo.lnk")
$Shortcut.TargetPath = "C:\ProgramData\chocolatey\bin\Bginfo.exe"
$Shortcut.Arguments = "/nolicprompt /timer:0"
$Shortcut.Save()
}
# Run bginfo right now
C:\ProgramData\chocolatey\bin\Bginfo.exe /nolicprompt /timer:0
if ($installVisualStudio) {
# This can take a really long time, so allow 2 hour timeout
# (ClickOnceV1 provides signtool.exe)
choco install VisualStudio2015Professional -packageParameters "--Features SilverLight_Developer_KitV1,ClickOnceV1" --execution-timeout=7200
cinst wixtoolset
cinst nodejs
cinst git
# .NET Core
choco install dotnetcore-sdk # Latest
if (-not (Get-Command -CommandType Application -ErrorAction SilentlyContinue -Name bower))
{
& "C:\Program Files\nodejs\npm.cmd" install -g bower
}
choco install visualstudio2017buildtools
choco install visualstudio2017-workload-webbuildtools
choco install visualstudio2017-workload-manageddesktop
choco install visualstudio2017-workload-netcoretools
}
if (Test-Path env:TeamCityServerUrl)
{
if (-not (Get-NetFirewallRule -DisplayName "Allow TeamCity" -ErrorAction Ignore))
{
New-NetFirewallRule -DisplayName "Allow TeamCity" -Direction Inbound -Protocol TCP -LocalPort 9090 -Action Allow
}
$teamCityServerUrl = $env:TeamCityServerUrl
$serviceAccount = $env:TeamCityServiceAccount
$serviceAccountPassword = $env:TeamCityServiceAccountPassword
cinst TeamCityAgent --ignore-checksums --params '"serverurl=$teamCityServerUrl serviceAccount=$serviceAccount serviceAccountPassword=$serviceAccountPassword"'
}
cinst teamcity-vstest-customlogger
# Install-WindowsUpdate -AcceptEula -GetUpdatesFromMS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment