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