Skip to content

Instantly share code, notes, and snippets.

@MartinSGill
Last active March 6, 2019 09:27
Show Gist options
  • Save MartinSGill/0ee2b9dddf503b6a752d7de1c63f5b70 to your computer and use it in GitHub Desktop.
Save MartinSGill/0ee2b9dddf503b6a752d7de1c63f5b70 to your computer and use it in GitHub Desktop.
BoxStarter Test
# Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('rawgist'))
# Powershell Provider
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# Ensure profile exists
New-Item -Path ~\Documents -Name WindowsPowerShell -ItemType Directory -Force
Set-Content -Value '' -Encoding Ascii -Path ~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
# Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n allowGlobalConfirmation
# Tools
CINST boxstarter
$env:PSModulePath += ';C:\ProgramData\Boxstarter'
CINST git
CINST notepadplusplus
CINST vscode
CINST dropbox
CINST GoogleChrome
# Settings
# Remove Useless Default Apps
@(
'*CandyCrush*'
'*bing*'
'ThumbmunkeysLtd.PhototasticCollage'
'DolbyLaboratories.DolbyAccess'
'Fitbit.FitbitCoach'
'Microsoft.MicrosoftOfficeHub'
'Microsoft.MicrosoftSolitaireCollection'
'*xbox*'
'*zune*'
) | % { Get-AppxPackage -Name $_ | Remove-AppxPackage -ErrorAction SilentlyContinue }
# UnPin Everything from Start
(New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items()| foreach { ($_).Verbs() | ?{$_.Name.Replace('&', '') -match 'From "Start" UnPin|Unpin from Start'} | %{$_.DoIt()} }
# Execution Policy
cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"
# Network Prompt
cmd.exe /c reg add "HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff"
# WinRM
cmd.exe /c winrm quickconfig -q
# Remote Admin Firewall
cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985"
cmd.exe /c net stop winrm
cmd.exe /c sc config winrm start= auto
cmd.exe /c net start winrm
Disable-UAC
Disable-BingSearch
Disable-GameBarTips
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableExpandToOpenFolder -EnableShowRibbon
Set-TaskbarOptions -Lock -Size Small -Dock Bottom -Combine Always
# # Run Command in start menu
# & "$env:SystemRoot\System32\reg.exe" ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Start_ShowRun /t REG_DWORD /d 1 /f
# # Admin Tools in start menu
# & "$env:SystemRoot\System32\reg.exe" ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v StartMenuAdminTools /t REG_DWORD /d 1 /f
# # No Hibernation file
# & "$env:SystemRoot\System32\reg.exe" ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f
# & "$env:SystemRoot\System32\reg.exe" ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f
# # Minimise Search Toolbar
# & "$env:SystemRoot\System32\reg.exe" ADD HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ /v Search /t REG_DWORD /d 2 /f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment