Skip to content

Instantly share code, notes, and snippets.

@michael-golfi
Last active March 29, 2019 21:19
Show Gist options
  • Save michael-golfi/c450df336723dcbd3ec8649788f4de1c to your computer and use it in GitHub Desktop.
Save michael-golfi/c450df336723dcbd3ec8649788f4de1c to your computer and use it in GitHub Desktop.
Windows Install Script
$User = Read-Host -Prompt "Input your username"
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).Downloa
dString('https://chocolatey.org/install.ps1'))
#
# Install Programs
#
choco install jre8 -y
choco install git /GitAndUnixToolsOnPath:true /NoAutoCrlf:true -y
choco install googlechrome -y
choco install firefox /PinnedToTaskbar:true -y
choco install androidstudio -y
choco install docker -y
choco install visualstudiocode -y
choco install golang -y
choco install spotify -y
choco install office365proplus -y
choco install f.lux -y
choco install dotnetcore -y
choco install ubiquiti-unifi-controller -y
choco install winrar -y
choco install nodejs -y
#
# Apply the start menu layout
#
$StartMenuUri = "https://gist.githubusercontent.com/michael-golfi/c450df336723dcbd3ec8649788f4de1c/raw/5db6f24386805f7b430e5e930cee18be23e77493/startmenu.xml"
$StartMenuPath = "C:\Users\$User\Downloads\startmenu.xml"
Invoke-WebRequest -Uri $StartMenuUri -OutFile $StartMenuPath
Import-StartLayout –LayoutPath $StartMenuPath –MountPath $env:SystemDrive\
$StoreRegistry = "HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store"
if (Test-Path $StoreRegistry) {
Remove-Item $FileName -Recurse
}
#
# Disable Running Apps On Startup By Name
#
# $StartupValue=([byte[]](0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00))
# $StartupPath="HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run"
# $AppsToDisable="Java Update Scheduler", "SpotifyWebHelper", "Surface DTX"
# $AppsToDisable | ForEach-Object -Process {Set-ItemProperty $StartupPath -Name $_ -Value $StartupValue}
#
# Create Public Outbound Firewall Rules
#
# $AllowedApps = @(
# @{ Name = "Allow Java JDK"; Desc = "Allow Outbound Java on Public Networks"; Path = "C:\program files\java\jdk1.8.0_152\jre\bin\java.exe" },
# @{ Name = "Allow Spotify"; Desc = "Allow Outbound Spotify on Public Networks"; Path = "C:\users\$User\appdata\roaming\spotify\spotify.exe" }
# )
# $AllowedApps | ForEach-Object -Process {New-NetFirewallRule -Program $_.Path -Action Allow -Profile Domain, Public -DisplayName $_.Name -Description $_.Desc -Direction Outbound}
# Need to relogin to apply start menu changes
<LayoutModificationTemplate xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
<LayoutOptions StartTileGroupCellWidth="6" StartTileGroupsColumnCount="1" />
<DefaultLayoutOverride>
<StartLayoutCollection>
<defaultlayout:StartLayout GroupCellWidth="6">
<start:Group Name="Leisure">
<start:Tile Size="4x2" Column="2" Row="0" AppUserModelID="Microsoft.BingWeather_8wekyb3d8bbwe!App" />
<start:Tile Size="2x2" Column="0" Row="0" AppUserModelID="microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.calendar" />
<start:Tile Size="1x1" Column="0" Row="2" AppUserModelID="SpotifyAB.SpotifyMusic_zpdnekdrzrea0!Spotify" />
<start:Tile Size="1x1" Column="1" Row="2" AppUserModelID="4DF9E0F8.Netflix_mcm4njqhnhss8!Netflix.App" />
</start:Group>
<start:Group Name="Productivity">
<start:DesktopApplicationTile Size="1x1" Column="0" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Word 2016.lnk" />
<start:DesktopApplicationTile Size="1x1" Column="2" Row="1" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\Microsoft Corporation\Microsoft Teams.lnk" />
<start:DesktopApplicationTile Size="1x1" Column="2" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Excel 2016.lnk" />
<start:DesktopApplicationTile Size="1x1" Column="3" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\OneNote 2016.lnk" />
<!--start:Tile Size="1x1" Column="1" Row="1" AppUserModelID="Microsoft.DynamicsAX2012Expenses_8wekyb3d8bbwe!App" /-->
<!--start:DesktopApplicationTile Size="1x1" Column="0" Row="1" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017.lnk" /-->
<start:DesktopApplicationTile Size="1x1" Column="1" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Outlook 2016.lnk" />
<start:DesktopApplicationTile Size="1x1" Column="0" Row="1" DesktopApplicationLinkPath="%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Android Studio\Android Studio.lnk" />
</start:Group>
</defaultlayout:StartLayout>
</StartLayoutCollection>
</DefaultLayoutOverride>
<CustomTaskbarLayoutCollection PinListPlacement="Replace">
<defaultlayout:TaskbarLayout>
<taskbar:TaskbarPinList>
<taskbar:DesktopApp DesktopApplicationLinkPath="%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Mozilla Firefox.lnk" />
<taskbar:DesktopApp DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk" />
</taskbar:TaskbarPinList>
</defaultlayout:TaskbarLayout>
</CustomTaskbarLayoutCollection>
</LayoutModificationTemplate>
@michael-golfi
Copy link
Author

michael-golfi commented Nov 27, 2017

Other tidbit issues:

  • Need to script the start menu tile layout.
  • Need to script the taskbar layout.
  • Need to add scripts to install Netflix and Spotify among other UWP apps
  • Install Git ssh keys by default
  • Needs Outbound Firewall rules:
    • Java Apps
    • Spotify (win32)
    • Android Studio
  • Starting the Unifi controller complains about not recognizing a local certificate. Need to find out how to trust certificates/make exceptions from Powershell (location:https://localhost:8443).
  • Disable most startup apps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment