Skip to content

Instantly share code, notes, and snippets.

@adamaig
Last active May 26, 2023 05:54
Show Gist options
  • Select an option

  • Save adamaig/93b13258056596673735ef3a4475aa10 to your computer and use it in GitHub Desktop.

Select an option

Save adamaig/93b13258056596673735ef3a4475aa10 to your computer and use it in GitHub Desktop.
Bootstrap Win11 for MB Development in Parallels
#Requires -RunAsAdministrator
md C:\iis
md C:\iis\wwwroot
md C:\iis\wwwroot\Applications
cd C:\iis\wwwroot\Applications\
git clone https://mindbody.visualstudio.com/mb/_git/Mindbody.Web.Clients
cd .\Mindbody.Web.Clients\
.\Web\BuildTools\setupDependencies.ps1
# Update paths
refreshenv
.\Web\BuildTools\install.ps1
#Requires -RunAsAdministrator
Param(
[Parameter(Mandatory, HelpMessage = "PAT paramenter must be set.")]
[string]$PAT
)
if ($PAT -eq '') {
Read-Host -Prompt "Please enter your ADO PAT with Package (Read) permissions: "
}
# Enable winget
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
# Install Git
winget install --id Git.Git -e --source winget --silent
# Install choclatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Update Path and other variables
refreshenv
# setup choclatey sources
choco source add -n=adops-choco -s="https://pkgs.dev.azure.com/mindbody/_packaging/chocolatey/nuget/v2" -u="mindbody" -p="$PAT" --priority=1
# Install NuGet
choco install nuget.commandline
# setup nuget sources
nuget sources add -name Arcus -source "https://mindbody.pkgs.visualstudio.com/_packaging/Mindbody-Nuget/nuget/v3/index.json" -username $env:USERNAME -password $PAT
nuget sources add -name MBO-DEV -source "https://nuget.mbodev.me/nuget"
# Setup npmrc
# Convert PAT to Base64 for npmrc
[string]$PAT64 = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($PAT))
[string]$MBEMAIL = "$env:[email protected]"
$npmrc = @"
; begin auth token
//pkgs.dev.azure.com/mindbody/_packaging/mb2-npm/npm/registry/:username=mindbody
//pkgs.dev.azure.com/mindbody/_packaging/mb2-npm/npm/registry/:_password=$PAT64
//pkgs.dev.azure.com/mindbody/_packaging/mb2-npm/npm/registry/:email=$MBEMAIL
//pkgs.dev.azure.com/mindbody/_packaging/mb2-npm/npm/:username=mindbody
//pkgs.dev.azure.com/mindbody/_packaging/mb2-npm/npm/:_password=$PAT64
//pkgs.dev.azure.com/mindbody/_packaging/mb2-npm/npm/:email=$MBEMAIL
; end auth token
"@
Add-Content C:\$env:HOMEPATH\.npmrc $npmrc
# Install VS2019 Enterprise with all workloads
choco install visualstudio2019enterprise -y --package-parameters "--add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.VisualStudio.Workload.Node --add Microsoft.VisualStudio.Workload.ManagedDesktop --includeRecommended --includeOptional --passive --locale en-US"
# Update paths
refreshenv

Simple Scripts for Installing Basic Dev Environment

This command set is in development right now.

$baseGIST = "https://gist.githubusercontent.com/adamaig/93b13258056596673735ef3a4475aa10/raw/3050129835bd1c8d4275c75f991c460a7a06406d"
$bootstrapWin11MBDev = "$baseGIST/bootstrapWin11MBDev.ps1"
$bootstrapClientsWeb = "$baseGIST/bootstrapClientsWeb.ps1"

Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-WebRequest -Uri $bootstrapWin11MBDev -OutFile C:\bootstrapWin11MBDev.ps1; Invoke-WebRequest -Uri $bootstrapClientsWeb -OutFile C:\bootstrapClientsWeb.ps1 

C:\bootstrapWin11MBDev.ps1

C:\bootstrapClientsWeb.ps1 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment