Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewbbrown/ff1a91cbdec9a0f5b9cb195bd416e3f0 to your computer and use it in GitHub Desktop.
Save andrewbbrown/ff1a91cbdec9a0f5b9cb195bd416e3f0 to your computer and use it in GitHub Desktop.
Boxstarter-Win10-BaseDevSettings-Updates.ps1
try {
# Boxstarter options
$Boxstarter.RebootOk=$true
$Boxstarter.NoPassword=$false # Is this a machine with no logon password?
$Boxstarter.AutoLogin=$true
Write-BoxstarterMessage "Ensuring ExecutionPolicy to Unrestricted..."
Update-ExecutionPolicy Unrestricted
Write-BoxstarterMessage "Ensuring UAC is disabled..."
Disable-UAC
#########################
#### requires reboot ####
#########################
Write-BoxstarterMessage "Ensuring Internet Explorer ESC (IESC) is disabled..."
Disable-InternetExplorerESC
Write-BoxstarterMessage "Ensuring PSGallery is a trusted PSRepository..."
Get-PackageProvider -Name NuGet -ForceBootstrap
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Write-BoxstarterMessage "Ensuring the PowerShellGet module is installed..."
Install-Module -Name PowerShellGet -Scope AllUsers -Force
#################################
#### NOW get windows updates ####
#################################
Write-BoxstarterMessage "Getting and Installing Critical Windows Updates..."
Install-WindowsUpdate -AcceptEula
Write-BoxstarterMessage "Ensuring Windows Updates is enabled..."
Enable-MicrosoftUpdate
#Install-WindowsUpdate -GetUpdatesFromMS -AcceptEula
###############################
#### windows features ####
###############################
Write-BoxstarterMessage "Ensuring that Windows Explorer Settings are correct (Developer features... file extensions... full file paths... show hidden files... show protected os files...)"
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Write-BoxstarterMessage "Ensuring remote desktop is enabled..."
Enable-RemoteDesktop
Write-BoxstarterMessage "Ensuring Bing Internet Search is disabled..."
Disable-BingSearch
Write-BoxstarterMessage "Ensuring Game Bar Tips is disabled..."
Disable-GameBarTips
#Write-BoxstarterMessage "Moving personal library directory to SkyDrive..."
#Move-LibraryDirectory "Personal" "$env:UserProfile\skydrive\documents"
#################
#### cleanup ####
#################
del C:\eula*.txt
del C:\install.*
del C:\vcredist.*
del C:\vc_red.*
################################
#### restore disabled stuff ####
################################
Write-BoxstarterMessage "Ensuring UAC is enabled once again..."
Enable-UAC
Write-BoxstarterMessage "Ensuring there are no additional Windows Updates to get..."
Install-WindowsUpdate -AcceptEula
Write-BoxstarterMessage "Machine is complete!"
}
catch {
Write-ChocolateyFailure 'Boxstarter Error: ' $($_.Exception.Message)
throw
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment