Skip to content

Instantly share code, notes, and snippets.

@BarDev
Last active March 4, 2022 15:15
Show Gist options
  • Save BarDev/5554be8395538d6738fa131487498336 to your computer and use it in GitHub Desktop.
Save BarDev/5554be8395538d6738fa131487498336 to your computer and use it in GitHub Desktop.
Windows Setup
BoxStarter Config Gists
Includes
- BoxStarter-Applications.txt
- BoxStarter-Window-10.txt
- Windows $Profile
;Maps Keyboard for my surface pro
^Media_Play_Pause::^CtrlBreak
#choco install googlechrome
#choco install gow
#choco install cmder
#choco install greenshot
#choco install totalcommander
#choco install wget
#choco install sublimetext3
choco install cmder
choco install curl
#choco install youtube-dl
choco install nodejs.install
choco install 7zip.install
choco install git.install
choco install poshgit
choco install sysinternals
#choco install putty
#choco install vim
choco install procexp
choco install sourcetree
choco install tortoisegit
#choco install irfanview
#choco install nmap
#choco install gittfs
choco install sumatrapdf.install
choco install visualstudiocode
#choco install launchy
choco install lastpass
choco install autoruns
#choco install github
#choco install dropbox
#choco install googledrive
#choco install calibre
choco install vlc
choco install fiddler4
#choco install itunes
#choco install mp3tag
#choco install steam
#choco install spotify
choco install paint.net
choco awscli
choco awstools.powershell
choco virtualbox
choco virtualbox.extensionpack
#choco install visualstudio2015enterprise
Choco linqpad4 -y
Choco notepadplusplus -x86
choco install python
choco install awscli
choco install awstools.powershell
#choco install sql-server-management-studio
choco install postman
#choco install visualstudio2017enterprise
#Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Google\Chrome\Application\chrome.exe"
#Install-ChocolateyPinnedTaskBarItem "$($Boxstarter.programFiles86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"
<#
Other Tools and Apps to install
- Snagit
- ? Aws CLI using Pip
#>
# Windows configuration code based off of this gist: https://gist.github.com/lebsral/40e977f9036f820bc78e
# >>> Start of 40e977f9036f820bc78e
# START http://boxstarter.org/package/url?https://gist.githubusercontent.com/troyehall/9be51fc7dc5b8adae90ee2003c717420/raw/cb0434e8a495a753816fac92c542fba650664d53/gistfile1.txt
#Run in Powershell or CMD administrator
#####Still Needs to be done manually
##Remove WMP from Taskbar
##Move all desktop shortcuts to HBS folder
##Add printers
##Map Network drives
try {
###### Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
#set up Windows
################
#### Temporary while doing this script. Will turn it back on at the end.
Disable-UAC
##### We want to do MS updates. But only, when we say to do it.
Disable-MicrosoftUpdate
##########set up time right
net stop w32time
w32tm /unregister
w32tm /unregister
w32tm /register
reg add hklm\system\currentcontrolset\services\w32time\parameters\ /v NtpServer /t reg_sz /d time.nist.gov /f
net start w32time
w32tm /resync /rediscover
#############
### Make the powerbutton "Restart" by default
##reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_PowerButtonAction /t REG_DWORD /d 4 /f
## Show "run" in start menu
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_ShowRun /t REG_DWORD /d 1 /f
## Don't highlight new apps
#reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_NotifyNewApps /t REG_DWORD /d 0 /f
## Show network places
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_ShowNetPlaces /t REG_DWORD /d 1 /f
## Show recent documents
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_ShowRecentDocs /t REG_DWORD /d 1 /f
####change power settings for installs
########################
#Write-BoxstarterMessage "Setting Windows power plan to $preferredPlan"
#$guid = (Get-WmiObject -Class win32_powerplan -Namespace root\cimv2\power -Filter "ElementName='High performance'").InstanceID.tostring()
#$regex = [regex]"{(.*?)}$"
#$newpowerVal = $regex.Match($guid).groups[1].value
#powercfg -S $newpowerVal
Write-BoxstarterMessage "Setting Standby Timeout to Never"
powercfg -change -standby-timeout-ac 0
powercfg -change -standby-timeout-dc 0
Write-BoxstarterMessage "Setting Monitor Timeout to 20 minutes"
powercfg -change -monitor-timeout-ac 20
powercfg -change -monitor-timeout-dc 20
Write-BoxstarterMessage "Setting Disk Timeout to Never"
powercfg -change -disk-timeout-ac 0
powercfg -change -disk-timeout-dc 0
Write-BoxstarterMessage "Turning off Windows Hibernation"
powercfg -h off
cinst PowerShell
if (Test-PendingReboot) { Invoke-Reboot }
Set-WindowsExplorerOptions -DisableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -DisableShowFileExtensions -EnableShowFullPathInTitleBar
Set-TaskbarOptions -Size Small -UnLock -Combine Never
if (Test-PendingReboot) { Invoke-Reboot }
# Enable Developer Mode & Install Bash
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -All -NoRestart
########################
### Make Project Folder
Write-BoxstarterMessage "Creating Folders "
New-Item -path "C:\Project" -type directory -force
New-Item -path "C:\Project\ScratchPad" -type directory -force
New-Item -path "C:\Project\Learning" -type directory -force
########################
#### Make and HBS folder
# C:\HBS
#if (!(Test-Path -Path C:\HBS )) {
#mkdir C:\HBS
#}
#Write-BoxstarterMessage "Made HBS folder"
#### Move all on the desktop in this user to the HBS folder
#### Should always be logged in as the admin or this will make a mess of user's desktop
#move /Y %UserProfile%\Desktop\*.* C:\HBS\
#Windows Update time
########################
### Get the first round of windows critical updates
Install-WindowsUpdate -getUpdatesFromMS -acceptEula -SuppressReboots
if (Test-PendingReboot) { Invoke-Reboot }
Write-BoxstarterMessage "First round of updates done"
if (Test-PendingReboot) { Invoke-Reboot }
cinst GoogleChrome
if (Test-PendingReboot) { Invoke-Reboot }
#cinst malwarebytes
#cinst javaruntime
cinst PSWindowsUpdate
Write-BoxstarterMessage "limited Apps installed"
## Install Windows Features
cinst TelnetClient -source windowsFeatures
###Enable Remote Desktop
Enable-RemoteDesktop
### Get more the Windows updates and keep getting them
Update-ExecutionPolicy Unrestricted
Install-WindowsUpdate -acceptEula
Enable-MicrosoftUpdate
#### Schedule updates to applications with chocolatey
#schtasks.exe /create /s "localhost" /ru "System" /tn "Update Chocolatey packages" /tr "%ChocolateyInstall%\bin\cup all" /sc DAILY /st 06:00 /F
#Write-BoxstarterMessage "Set update schedule for apps"
#if (Test-PendingReboot) { Invoke-Reboot }
#Write-BoxstarterMessage "about to do DNS"
####### OPEN DNS ####### and Norton 1 to be added 199.85.127.10
#netsh interface ip set dns "Local Area Connection" static 208.67.222.222
#netsh interface ip add dns name="Local Area Connection" addr=208.67.220.220
#netsh interface ip set dns "Connectify" static 208.67.222.222
#netsh interface ip add dns name="Connectify" addr=208.67.220.220
#netsh interface ip set dns "Wireless Network Connection" static 208.67.222.222
#netsh interface ip add dns name="Wireless Network Connection" addr=208.67.220.220
#Write-BoxstarterMessage "did DNS"
### Change IE to start with google ###
REG ADD "HKCU\Software\Microsoft\Internet Explorer\Main" /V "Start Page" /D "http://www.google.com/" /F
Write-BoxstarterMessage "about do do user info"
##Get all user info
<#
Write-BoxstarterMessage "about do choco list"
choco list -localonly >C:\HBS\myinfo.txt
Write-BoxstarterMessage "about do do whoami"
#whoami /all /fo csv >C:\HBS\myinfo.csv
Write-BoxstarterMessage "about do do getmac"
getmac >>C:\HBS\myinfo.csv
Write-BoxstarterMessage "about do do ipconfig"
ipconfig /all >>C:\HBS\myinfo.csv
Write-BoxstarterMessage "about do do wmic"
wmic csproduct get vendor,name,identifyingnumber >>C:\HBS\myinfo.csv
Write-BoxstarterMessage "did user info into 2 files myinfo .csv and .txt"
#>
#set up Windows for normal
################
Enable-MicrosoftUpdate
#Turn UAC Back on
Enable-UAC
# Clean up Boxstarter autologin
# Note: keep this last in the script
$winLogonKey="HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
Remove-ItemProperty -Path $winLogonKey -Name "DefaultUserName" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $winLogonKey -Name "DefaultDomainName" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $winLogonKey -Name "DefaultPassword" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $winLogonKey -Name "AutoAdminLogon" -ErrorAction SilentlyContinue
} catch {
# Write-ChocolateyFailure 'HBSinstall' $($_.Exception.Message)
throw $_.Exception
}
# <<< End of 40e977f9036f820bc78e
#This works with Poshgit to display git status in prompt
$GitPromptSettings.DefaultPromptSuffix = '`n$(''>'' * ($nestedPromptLevel + 1)) '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment