Skip to content

Commit 725c4da

Browse files
crutkasyodurr
authored andcommitted
Update dev_box (#49)
Update dev_app.ps1 to - UWP Workload - Azure workload - Windows Template Studio - disabling hyper-v and WSL for now since choco would throw errors (will investigate)
1 parent 872a12d commit 725c4da

File tree

1 file changed

+52
-9
lines changed

1 file changed

+52
-9
lines changed

dev_app.ps1

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
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 ---
714
#--- Windows Features ---
815
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
916

@@ -13,17 +20,53 @@ Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\
1320
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1
1421
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2
1522

16-
#--- Windows Subsystems/Features ---
17-
choco install -y Microsoft-Hyper-V-All -source windowsFeatures
18-
choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures
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 ---
27+
# See this for install args: https://chocolatey.org/packages/VisualStudio2017Community
28+
# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community
29+
# 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;
1965

20-
#--- Tools ---
21-
choco install -y visualstudio2017community # See this for install args: https://chocolatey.org/packages/VisualStudio2017Community
22-
choco install -y sysinternals
23-
# choco install -y docker-for-windows
66+
Remove-Item $wtsVsix
2467

25-
# TODO: should pass install args to VS2017 to install additional options
2668

69+
#--- reenabling critial items ---
2770
Enable-UAC
2871
Enable-MicrosoftUpdate
29-
Install-WindowsUpdate -acceptEula
72+
Install-WindowsUpdate -acceptEula

0 commit comments

Comments
 (0)