Created
April 16, 2018 00:01
-
-
Save andrewbbrown/f8884e1f7e985e33babeb2d9748afcbf to your computer and use it in GitHub Desktop.
Boxstarter-Win2k16-BaseDevSettings-Updates.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "Disabling Bing Internet Search..." | |
Disable-BingSearch | |
################# | |
#### 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