Skip to content

Instantly share code, notes, and snippets.

@andrewbbrown
Last active January 24, 2018 05:13
Show Gist options
  • Save andrewbbrown/ba252d923fc968cb9c6aeb97e7f23c69 to your computer and use it in GitHub Desktop.
Save andrewbbrown/ba252d923fc968cb9c6aeb97e7f23c69 to your computer and use it in GitHub Desktop.
try {
# Boxstarter options
$Boxstarter.RebootOk=$true
$Boxstarter.NoPassword=$false # Is this a machine with no logon password?
$Boxstarter.AutoLogin=$true
Update-ExecutionPolicy Unrestricted
Disable-UAC
Write-BoxstarterMessage "Turning off Windows Hibernation"
powercfg -h off
#########################
#### requires reboot ####
#########################
Disable-InternetExplorerESC
cinst dotnet3.5
cinst dotnet4.7
cinst powershell
#######################
#### general utils ####
#######################
cinst chocolatey-core.extension
cinst 7zip.install
cinst googlechrome
cinst firefox
cinst flashplayerplugin
cinst notepadplusplus.install
cinst filezilla
cinst sysinternals
cinst visualstudiocode
cinst windirstat
#cinst citrix-receiver
cinst github
cinst poshgit
cinst putty.install -y
cinst vmwarevsphereclient -y
cinst vmware-tools -y
cinst jre8
#Getting the Package PRovider to work...
#Install-PackageProvider Nuget –force
#Install-Module –Name PowerShellGet –Force
# Installing PowerCLI
#Install-Module -Name VMware.PowerCLI -SkipPublisherCheck -Force
#Installing PowerNSX
#Find-Module PowerNSX | Install-Module -Force
#################################
#### NOW get windows updates ####
#################################
Enable-MicrosoftUpdate
#Install-WindowsUpdate -AcceptEula
Install-WindowsUpdate -GetUpdatesFromMS -AcceptEula
#################
#### cleanup ####
#################
del C:\eula*.txt
del C:\install.*
del C:\vcredist.*
del C:\vc_red.*
###############################
#### windows features ####
###############################
#Installing Windows Features for Active Directory...
cinst DirectoryServices-DomainController -source windowsfeatures
cinst DirectoryServices-DomainController-Tools -source windowsfeatures
cinst DirectoryServices-AdministrativeCenter -source windowsfeatures
cinst ADCertificateServicesRole -source windowsfeatures
cinst ADCertificateServicesManagementTools -source windowsfeatures
cinst ActiveDirectory-PowerShell -source windowsfeatures
#cinst DirectoryServices-ADAM-Tool -source windowsfeatures
#cinst DirectoryServices-ADAM -source windowsfeatures
cinst RSAT -source windowsfeatures
cinst RSAT-AD-Tools-Feature -source windowsfeatures
cinst RSAT-ADDS-Tools-Feature -source windowsfeatures
cinst DNS-Server-Full-Role -source windowsfeatures
cinst DNS-Server-Tools -source windowsfeatures
cinst DHCPServer -source windowsfeatures
cinst DHCPServer-Tools -source windowsfeatures
cinst RemoteAccessMgmtTools -source windowsfeatures
cinst RemoteAccessPowerShell -source windowsfeatures
# Setting Time Zone
Write-BoxstarterMessage "Setting time zone to Central Standard Time"
& C:\Windows\system32\tzutil /s "Central Standard Time"
###############################
#### windows configuration ####
###############################
### do this here so that it only happens once (shouldn't reboot any more at this point)
Enable-RemoteDesktop
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
#Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen
#for Server operating systems...
#Disable-InternetExplorerESC
#Set-TaskbarOptions -Size Small
#Fix Timezone
#Get-WindowsFeature AD-Domain-Services | Install-WindowsFeature -IncludeAllSubFeature -IncludeManagementTools
#Get-WindowsFeature DNS | Install-WindowsFeature -IncludeAllSubFeature
####### NEED TO RENAME PC AND RESTART BEFORE AD SETUP
#Rename-Computer -NewName WIN2K12R2-01 -Restart
#cinst ActiveDirectory-PowerShell -source windowsfeatures
#cinst DirectoryServices-DomainController -source windowsfeatures
#cinst DirectoryServices-DomainController-Tools -source windowsfeatures
#cinst -source windowsfeatures
#cinst -source windowsfeatures
#cinst IIS-WebServerRole -source windowsfeatures
################################
#### restore disabled stuff ####
################################
Enable-UAC
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