Skip to content

Commit 9270cd2

Browse files
authored
adding common scripts for use by multiple dev scenario scripts (#59)
This PR gets Master up to date with the common scripts approach. These are not done but this seems far enough along to proceed. We'll now move forward with refining these common scripts along with the dev scenario scripts that reference them.
1 parent 2eac845 commit 9270cd2

11 files changed

+244
-167
lines changed

dev_app.ps1

Lines changed: 32 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,41 @@
44

55
Disable-UAC
66

7-
#--- Windows Subsystems/Features ---
8-
#choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures
9-
#choco install -y Microsoft-Hyper-V-All -source windowsFeatures
10-
#choco install -y sysinternals
11-
#choco install -y docker-for-windows
12-
13-
#--- Configuring Windows properties ---
14-
#--- Windows Features ---
15-
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
16-
17-
#--- File Explorer Settings ---
18-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1
19-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1
20-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1
21-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2
22-
23-
#--- Enabling developer mode on the system ---
24-
Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowDevelopmentWithoutDevLicense -Value 1
25-
26-
#--- VS 2017 uwp and azure workloads + git tools ---
7+
# see if we can't get calling URL somehow, that would eliminate this need
8+
# should move to a config file
9+
$user = "Microsoft";
10+
$baseBranch = "BreakUpScripts";
11+
$finalBaseHelperUri = "https://raw.githubusercontent.com/$user/windows-dev-box-setup-scripts/$baseBranch/scripts";
12+
13+
function executeScript {
14+
Param ([string]$script)
15+
write-host "executing $finalBaseHelperUri/$script ..."
16+
iex ((new-object net.webclient).DownloadString("$finalBaseHelperUri/$script"))
17+
}
18+
19+
#--- Setting up Windows ---
20+
executeScript "SystemConfiguration.ps1";
21+
executeScript "FileExplorerSettings.ps1";
22+
executeScript "RemoveDefaultApps.ps1";
23+
executeScript "CommonDevTools.ps1";
24+
25+
#--- Tools ---
26+
#--- Installing VS and VS Code with Git
2727
# See this for install args: https://chocolatey.org/packages/VisualStudio2017Community
2828
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community
2929
# https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio#list-of-workload-ids-and-component-ids
30-
choco install visualstudio2017community --package-parameters "--add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Component.Git"
31-
RefreshEnv
32-
33-
choco install visualstudio2017-workload-universal
34-
35-
#--- grabbing latest UWP Samples off Github ---
36-
RefreshEnv
37-
cd $env:USERPROFILE\desktop
38-
mkdir UwpSamples
39-
cd UwpSamples
40-
git clone https://github.com/Microsoft/Windows-universal-samples/
41-
42-
# installing Windows Template Studio VSIX
43-
#choco was claiming dev 15 can't do this anymore for vsix... odd hasn't been fixed yet
44-
#Install-ChocolateyVsixPackage -PackageName "Windows Template Studio" -VsixUrl $wtsFileUrl.source
45-
46-
$requestUri = 'https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery'
47-
$requestBody = '{"flags":"262","filters":[{"criteria":[{"filterType":"10","value":"windows template studio"}],"sortBy":"0","sortOrder":"2","pageSize":"25","pageNumber":"1"}]}'
48-
$requestHeaders = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
49-
$requestHeaders.Add('Accept','application/json; api-version=3.2-preview.1')
50-
$requestHeaders.Add('Content-Type','application/json; charset=utf-8')
51-
52-
$results = Invoke-WebRequest -Uri $requestUri -Method POST -Headers $requestHeaders -Body $requestBody -UseBasicParsing
53-
54-
$jsonResults = $results.Content | ConvertFrom-Json
55-
$wtsResults = $jsonResults.results[0].extensions | where {$_.extensionName -eq "WindowsTemplateStudio"}
56-
$wtsFileUrl = $wtsResults.versions[0].files | where {$_.assetType -eq "Microsoft.Templates.2017.vsix"}
57-
58-
$wtsVsix = [System.IO.Path]::GetFileName($wtsFileUrl.source)
59-
$wtsFullPath = [System.IO.Path]::Combine((Resolve-Path .\).Path, $wtsVsix);
60-
Invoke-WebRequest -Uri $wtsFileUrl.source -OutFile $wtsVsix
61-
$vsixInstallerFile = Get-Childitem -Include vsixinstaller.exe -Recurse -Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\"
62-
$wtsArgList = $wtsFullPath + " /q"
63-
64-
$vsixInstallerResult = Start-Process -FilePath $vsixInstallerFile.FullName -ArgumentList $wtsArgList -Wait -PassThru;
65-
66-
Remove-Item $wtsVsix
67-
30+
# visualstudio2017community
31+
# visualstudio2017professional
32+
# visualstudio2017enterprise
33+
34+
choco install visualstudio2017community -y --package-parameters "--add Microsoft.VisualStudio.Component.Git"
35+
RefreshEnv #refreshing env due to Git install
36+
37+
#--- UWP Workload and installing Windows Template Studio ---
38+
choco install -y visualstudio2017-workload-azure
39+
choco install -y visualstudio2017-workload-universal
40+
executeScript "WindowsTemplateStudio.ps1";
41+
executeScript "GetUwpSamplesOffGithub.ps1";
6842

6943
#--- reenabling critial items ---
7044
Enable-UAC

dev_ml_python.ps1

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,27 @@
44

55
Disable-UAC
66

7-
#--- Windows Features ---
8-
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
9-
10-
#--- File Explorer Settings ---
11-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1
12-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1
13-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1
14-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2
15-
16-
#--- Git ---
17-
choco install -y git -params '"/GitAndUnixToolsOnPath /WindowsTerminal"'
18-
19-
#--- Windows Subsystems/Features ---
20-
choco install -y Microsoft-Hyper-V-All -source windowsFeatures
21-
choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures
22-
23-
#--- Ubuntu ---
24-
# Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.appx -UseBasicParsing
25-
# Add-AppxPackage -Path ~/Ubuntu.appx
26-
27-
#--- Fonts ---
28-
choco install -y inconsolata
29-
# choco install -y ubuntu.font
30-
31-
#--- Tools ---
32-
choco install -y docker-for-windows
33-
choco install -y python
34-
choco install -y 7zip.install
7+
# see if we can't get calling URL somehow, that would eliminate this need
8+
# should move to a config file
9+
$user = "Microsoft";
10+
$baseBranch = "BreakUpScripts";
11+
$finalBaseHelperUri = "https://raw.githubusercontent.com/$user/windows-dev-box-setup-scripts/$baseBranch/scripts";
12+
13+
function executeScript {
14+
Param ([string]$script)
15+
write-host "executing $finalBaseHelperUri/$script ..."
16+
iex ((new-object net.webclient).DownloadString("$finalBaseHelperUri/$script"))
17+
}
18+
19+
#--- Setting up Windows ---
20+
executeScript "SystemConfiguration.ps1";
21+
executeScript "FileExplorerSettings.ps1";
22+
executeScript "RemoveDefaultApps.ps1";
23+
executeScript "CommonDevTools.ps1";
24+
executeScript "VirtualizationTools.ps1";
3525

3626
# TODO: install additional ML tools
3727

38-
#--- VS Code ---
39-
choco install -y vscode
40-
41-
#--- VS Code extensions ---
42-
choco install -y vscode-docker
43-
4428
Enable-UAC
4529
Enable-MicrosoftUpdate
4630
Install-WindowsUpdate -acceptEula

dev_web.ps1

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,39 @@
11
# Description: Boxstarter Script
22
# Author: Microsoft
3-
# Common dev settings for web dev
3+
# Common settings for web dev
44

55
Disable-UAC
66

7-
#--- Windows Features ---
8-
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
9-
10-
#--- File Explorer Settings ---
11-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1
12-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1
13-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1
14-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2
7+
function executeScript {
8+
Param ([string]$script)
9+
write-host "executing $finalBaseHelperUri/$script ..."
10+
iex ((new-object net.webclient).DownloadString("$finalBaseHelperUri/$script"))
11+
}
12+
13+
# see if we can't get calling URL somehow, that would eliminate this need
14+
# should move to a config file
15+
$user = "Microsoft";
16+
$baseBranch = "BreakUpScripts";
17+
$finalBaseHelperUri = "https://raw.githubusercontent.com/$user/windows-dev-box-setup-scripts/$baseBranch/scripts";
18+
19+
#--- Setting up Windows ---
20+
executeScript "FileExplorerSettings.ps1";
21+
executeScript "SystemConfiguration.ps1";
22+
executeScript "CommonDevTools.ps1";
23+
executeScript "RemoveDefaultApps.ps1";
24+
executeScript "VirtualizationTools.ps1";
1525

1626
#--- Tools ---
17-
choco install -y vscode
1827
code --install-extension msjsdiag.debugger-for-chrome
1928
code --install-extension msjsdiag.debugger-for-edge
2029

21-
choco install -y git -params '"/GitAndUnixToolsOnPath /WindowsTerminal"'
22-
choco install -y 7zip.install
23-
24-
#--- Windows Subsystems/Features ---
25-
choco install -y Microsoft-Hyper-V-All -source windowsFeatures
26-
choco install Microsoft-Windows-Subsystem-Linux -source windowsfeatures
27-
28-
#--- Ubuntu ---
29-
# Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.appx -UseBasicParsing
30-
# Add-AppxPackage -Path ~/Ubuntu.appx
31-
32-
<#
33-
#--- SLES ---
34-
# Install SLES Store app
35-
Invoke-WebRequest -Uri https://aka.ms/wsl-sles-12 -OutFile ~/SLES.appx -UseBasicParsing
36-
Add-AppxPackage -Path ~/SLES.appx
37-
# Launch SLES
38-
sles-12.exe
39-
40-
# --- openSUSE ---
41-
Invoke-WebRequest -Uri https://aka.ms/wsl-opensuse-42 -OutFile ~/openSUSE.appx -UseBasicParsing
42-
Add-AppxPackage -Path ~/openSUSE.appx
43-
# Launch openSUSE
44-
opensuse-42.exe
45-
#>
46-
4730
#--- Browsers ---
4831
choco install -y googlechrome
4932
choco install -y firefox
5033

5134
#--- Microsoft WebDriver ---
5235
choco install -y microsoftwebdriver
5336

54-
#--- Fonts ---
55-
choco install -y inconsolata
56-
# choco install -y ubuntu.font
57-
58-
#--- Tools ---
59-
choco install -y sysinternals
60-
choco install -y docker-for-windows
61-
choco install -y python
62-
6337
Enable-UAC
6438
Enable-MicrosoftUpdate
6539
Install-WindowsUpdate -acceptEula

dev_web_nodejs.ps1

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,41 @@
11
# Description: Boxstarter Script
22
# Author: Microsoft
3-
# Common dev settings for web development
3+
# Common settings for web development with NodeJS
44

55
Disable-UAC
66

7-
#--- Windows Features ---
8-
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
9-
10-
#--- File Explorer Settings ---
11-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1
12-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1
13-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1
14-
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2
15-
16-
#--- Tools ---
17-
choco install -y vscode
18-
code --install-extension msjsdiag.debugger-for-chrome
19-
code --install-extension msjsdiag.debugger-for-edge
20-
21-
choco install -y git -params '"/GitAndUnixToolsOnPath /WindowsTerminal"'
22-
choco install -y 7zip.install
23-
24-
#--- Windows Subsystems/Features ---
25-
choco install -y Microsoft-Hyper-V-All -source windowsFeatures
26-
choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures
27-
28-
#--- Ubuntu ---
29-
# Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.appx -UseBasicParsing
30-
# Add-AppxPackage -Path ~/Ubuntu.appx
7+
# see if we can't get calling URL somehow, that would eliminate this need
8+
# should move to a config file
9+
$user = "Microsoft";
10+
$baseBranch = "BreakUpScripts";
11+
$finalBaseHelperUri = "https://raw.githubusercontent.com/$user/windows-dev-box-setup-scripts/$baseBranch/scripts";
12+
13+
function executeScript {
14+
Param ([string]$script)
15+
write-host "executing $finalBaseHelperUri/$script ..."
16+
iex ((new-object net.webclient).DownloadString("$finalBaseHelperUri/$script"))
17+
}
18+
19+
#--- Setting up Windows ---
20+
executeScript "SystemConfiguration.ps1";
21+
executeScript "FileExplorerSettings.ps1";
22+
executeScript "RemoveDefaultApps.ps1";
23+
executeScript "CommonDevTools.ps1";
24+
executeScript "VirtualizationTools.ps1";
3125

3226
#--- Browsers ---
3327
choco install -y Firefox
3428
choco install -y Googlechrome
3529

36-
#--- Fonts ---
37-
choco install -y inconsolata
38-
# choco install -y ubuntu.font
30+
#--- Tools ---
31+
code --install-extension msjsdiag.debugger-for-chrome
32+
code --install-extension msjsdiag.debugger-for-edge
3933

4034
#--- Tools ---
4135
choco install -y nodejs-lts # Node.js LTS, Recommended for most users
4236
# choco install -y nodejs # Node.js Current, Latest features
4337
choco install -y visualstudio2017buildtools
4438
choco install -y visualstudio2017-workload-vctools
45-
choco install -y sysinternals
46-
choco install -y docker-for-windows
4739
choco install -y python2 # Node.js requires Python 2 to build native modules
4840

4941
Enable-UAC

scripts/CommonDevTools.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
# tools we expect devs across many scenarios will want
3+
choco install -y vscode
4+
choco install -y git -params '"/GitAndUnixToolsOnPath /WindowsTerminal"'
5+
choco install -y python
6+
choco install -y 7zip.install
7+
choco install -y sysinternals

scripts/FileExplorerSettings.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#--- Configuring Windows properties ---
2+
#--- Windows Features ---
3+
# Show hidden files, Show protected OS files, Show file extensions
4+
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
5+
6+
#--- File Explorer Settings ---
7+
# will expand explorer to the actual folder you're in
8+
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1
9+
#adds things back in your left pane like recycle bin
10+
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1
11+
#opens PC to This PC, not quick access
12+
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1
13+
#taskbar where window is open for multi-monitor
14+
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2
15+

scripts/GetUwpSamplesOffGithub.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
RefreshEnv
2+
cd $env:USERPROFILE\desktop
3+
mkdir UwpSamples
4+
cd UwpSamples
5+
git clone https://github.com/Microsoft/Windows-universal-samples/

0 commit comments

Comments
 (0)