Skip to content

Commit 79bbe5b

Browse files
authored
Started a demoscripts folder, refactored some helper scripts (#70)
* moving all recipes to dynamically find helper scripts * started to a devops_azure script * re-organizing some existing scripts * updated Readme known issues
1 parent 01c3847 commit 79bbe5b

11 files changed

+125
-53
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ with a non-blank password. Use this user going forward. For more info on WSL ple
4949
2. If you're a Node.js contributor working on Node.js core, please see the [Node.js Bootstrapping Guide](https://github.com/nodejs/node/tree/master/tools/bootstrap) or [click here to run](http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter).
5050

5151
## Known issues
52-
- Reboot is not always logging you back in to resume the script. This is being tracked [here](https://github.com/chocolatey/boxstarter/issues/318). If you experience this please login manually and the script will continue running.
52+
- The Boxstarter ClickOnce installer does not work when using Chrome. This issue is being tracked [here](https://github.com/chocolatey/boxstarter/issues/345). Please use Edge to run the ClickOnce installer.
53+
- Reboot is not always logging you back in to resume the script. This is being tracked [here](https://github.com/chocolatey/boxstarter/issues/318). The workaround is to login manually and the script will continue running.
5354
- There have been reports of Windows 1803 not successfully launching Boxstarter via the web launcher. See this issue for details: https://github.com/chocolatey/boxstarter/issues/301
5455

5556
## Working with Chocolatey in an organization?

demos/chocolateyfest2018.ps1

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Description: Boxstarter Script
2+
# Author: Microsoft
3+
# Common settings for web dev
4+
5+
Disable-UAC
6+
7+
# Get the base URI path from the ScriptToCall value
8+
$bstrappackage = "-bootstrapPackage"
9+
$helperUri = $Boxstarter['ScriptToCall']
10+
$strpos = $helperUri.IndexOf($bstrappackage)
11+
$helperUri = $helperUri.Substring($strpos + $bstrappackage.Length)
12+
$helperUri = $helperUri.TrimStart("'", " ")
13+
$helperUri = $helperUri.TrimEnd("'", " ")
14+
$helperUri = $helperUri.Substring(0, $helperUri.LastIndexOf("/"))
15+
$helperUri += "/scripts"
16+
write-host "helper script base URI is $helperUri"
17+
18+
function executeScript {
19+
Param ([string]$script)
20+
write-host "executing $helperUri/$script ..."
21+
iex ((new-object net.webclient).DownloadString("$helperUri/$script"))
22+
}
23+
24+
#--- Setting up Windows ---
25+
executeScript "FileExplorerSettings.ps1";
26+
executeScript "SystemConfiguration.ps1";
27+
executeScript "CommonDevTools.ps1";
28+
executeScript "RemoveDefaultApps.ps1";
29+
executeScript "WSL.ps1";
30+
executeScript "VirtualizationTools.ps1";
31+
32+
#--- Browsers ---
33+
choco install -y googlechrome
34+
choco install -y firefox
35+
36+
# TODO: Expand on tools/configuration options here
37+
# Tools inside WSL
38+
# Azure CLI
39+
40+
Enable-UAC
41+
Enable-MicrosoftUpdate
42+
Install-WindowsUpdate -acceptEula

dev_ml_wsl.ps1

+3-5
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@ executeScript "SystemConfiguration.ps1";
2626
executeScript "FileExplorerSettings.ps1";
2727
executeScript "RemoveDefaultApps.ps1";
2828
executeScript "CommonDevTools.ps1";
29-
executeScript "VirtualizationTools.ps1";
30-
executeScript "GetMLPythonSamplesOffGithub.ps1";
29+
executeScript "HyperV.ps1";
30+
executeScript "WSL.ps1";
3131

3232
write-host "Installing tools inside the WSL distro..."
33-
Ubuntu1804 run apt update
34-
Ubuntu1804 run apt upgrade -y
35-
## Install Python tools
3633
Ubuntu1804 run apt install python2.7 python-pip -y
3734
Ubuntu1804 run apt install python-numpy python-scipy -y
3835
Ubuntu1804 run pip install pandas
36+
3937
write-host "Finished installing tools inside the WSL distro"
4038

4139
Enable-UAC

dev_web.ps1

+4-5
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@ executeScript "FileExplorerSettings.ps1";
2626
executeScript "SystemConfiguration.ps1";
2727
executeScript "CommonDevTools.ps1";
2828
executeScript "RemoveDefaultApps.ps1";
29-
executeScript "VirtualizationTools.ps1";
29+
executeScript "HyperV.ps1";
30+
executeScript "Docker.ps1";
31+
executeScript "WSL.ps1";
32+
executeScript "Browsers.ps1";
3033

3134
#--- Tools ---
3235
code --install-extension msjsdiag.debugger-for-chrome
3336
code --install-extension msjsdiag.debugger-for-edge
3437

35-
#--- Browsers ---
36-
choco install -y googlechrome
37-
choco install -y firefox
38-
3938
#--- Microsoft WebDriver ---
4039
choco install -y microsoftwebdriver
4140

dev_web_nodejs.ps1

+2-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@ executeScript "SystemConfiguration.ps1";
2626
executeScript "FileExplorerSettings.ps1";
2727
executeScript "RemoveDefaultApps.ps1";
2828
executeScript "CommonDevTools.ps1";
29-
executeScript "VirtualizationTools.ps1";
30-
31-
#--- Browsers ---
32-
choco install -y Firefox
33-
choco install -y Googlechrome
29+
executeScript "WSL.ps1";
30+
executeScript "Browsers.ps1";
3431

3532
#--- Tools ---
3633
code --install-extension msjsdiag.debugger-for-chrome

devops_azure.ps1

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Description: Boxstarter Script
2+
# Author: Microsoft
3+
# Common settings for azure devops
4+
5+
Disable-UAC
6+
7+
# Get the base URI path from the ScriptToCall value
8+
$bstrappackage = "-bootstrapPackage"
9+
$helperUri = $Boxstarter['ScriptToCall']
10+
$strpos = $helperUri.IndexOf($bstrappackage)
11+
$helperUri = $helperUri.Substring($strpos + $bstrappackage.Length)
12+
$helperUri = $helperUri.TrimStart("'", " ")
13+
$helperUri = $helperUri.TrimEnd("'", " ")
14+
$helperUri = $helperUri.Substring(0, $helperUri.LastIndexOf("/"))
15+
$helperUri += "/scripts"
16+
write-host "helper script base URI is $helperUri"
17+
18+
function executeScript {
19+
Param ([string]$script)
20+
write-host "executing $helperUri/$script ..."
21+
iex ((new-object net.webclient).DownloadString("$helperUri/$script"))
22+
}
23+
24+
#--- Setting up Windows ---
25+
executeScript "FileExplorerSettings.ps1";
26+
executeScript "SystemConfiguration.ps1";
27+
executeScript "RemoveDefaultApps.ps1";
28+
executeScript "WSL.ps1";
29+
executeScript "HyperV.ps1";
30+
executeScript "Docker.ps1";
31+
executeScript "Browsers.ps1";
32+
33+
# TODO: Expand on tools/configuration options here
34+
# Azure CLI, Azure PS, Azure SDK, Ansible, TerraForms
35+
36+
Enable-UAC
37+
Enable-MicrosoftUpdate
38+
Install-WindowsUpdate -acceptEula

scripts/Browsers.ps1

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#--- Browsers ---
2+
choco install -y googlechrome
3+
choco install -y firefox

scripts/Docker.ps1

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
choco install -y docker-for-windows
2+
choco install -y vscode-docker

scripts/GetMLPythonSamplesOffGithub.ps1

-6
This file was deleted.

scripts/HyperV.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
choco install -y Microsoft-Hyper-V-All -source windowsFeatures
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1-
2-
choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures
3-
choco install -y Microsoft-Hyper-V-All -source windowsFeatures
4-
# alternative to above: Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName Microsoft-Windows-Subsystem-Linux
5-
# alternative to above: Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName Microsoft-Hyper-V
6-
choco install -y docker-for-windows
7-
choco install -y vscode-docker
8-
9-
10-
#--- Ubuntu ---
11-
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ~/Ubuntu.appx -UseBasicParsing
12-
Add-AppxPackage -Path ~/Ubuntu.appx
13-
# run the distro once and have it install locally with a blank root user
14-
Ubuntu1804 install --root
15-
16-
<#
17-
NOTE: Other distros can be scripted the same way for example:
18-
19-
#--- SLES ---
20-
# Install SLES Store app
21-
Invoke-WebRequest -Uri https://aka.ms/wsl-sles-12 -OutFile ~/SLES.appx -UseBasicParsing
22-
Add-AppxPackage -Path ~/SLES.appx
23-
# Launch SLES
24-
sles-12.exe
25-
26-
# --- openSUSE ---
27-
Invoke-WebRequest -Uri https://aka.ms/wsl-opensuse-42 -OutFile ~/openSUSE.appx -UseBasicParsing
28-
Add-AppxPackage -Path ~/openSUSE.appx
29-
# Launch openSUSE
30-
opensuse-42.exe
31-
#>
1+
choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures
2+
3+
#--- Ubuntu ---
4+
# TODO: Move this to choco install once --root is included in that package
5+
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ~/Ubuntu.appx -UseBasicParsing
6+
Add-AppxPackage -Path ~/Ubuntu.appx
7+
# run the distro once and have it install locally with root user, unset password
8+
Ubuntu1804 install --root
9+
Ubuntu1804 run apt update
10+
Ubuntu1804 run apt upgrade -y
11+
12+
<#
13+
NOTE: Other distros can be scripted the same way for example:
14+
15+
#--- SLES ---
16+
# Install SLES Store app
17+
Invoke-WebRequest -Uri https://aka.ms/wsl-sles-12 -OutFile ~/SLES.appx -UseBasicParsing
18+
Add-AppxPackage -Path ~/SLES.appx
19+
# Launch SLES
20+
sles-12.exe
21+
22+
# --- openSUSE ---
23+
Invoke-WebRequest -Uri https://aka.ms/wsl-opensuse-42 -OutFile ~/openSUSE.appx -UseBasicParsing
24+
Add-AppxPackage -Path ~/openSUSE.appx
25+
# Launch openSUSE
26+
opensuse-42.exe
27+
#>
28+

0 commit comments

Comments
 (0)