Skip to content

Instantly share code, notes, and snippets.

@keyboardcrunch
Last active March 16, 2024 18:07
Show Gist options
  • Select an option

  • Save keyboardcrunch/ba61d6675c5c8d8ecbc016c7f31156d0 to your computer and use it in GitHub Desktop.

Select an option

Save keyboardcrunch/ba61d6675c5c8d8ecbc016c7f31156d0 to your computer and use it in GitHub Desktop.
Boxstarter single file example
$ChocoFile = Join-Path -Path $(Get-Location) -ChildPath "choco_config.txt"
$ChocoFileSettings = @'
# Software
choco install adobereader
choco install googlechrome
choco install firefox
choco install 7zip.install
# runtimes
choco install adoptopenjdk12
choco install dotnetfx
choco install dotnet3.5
choco install vcredist-all
# Tuning
Set-WindowsExplorerOptions -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowHiddenFilesFoldersDrives
Disable-BingSearch
Disable-GameBarTips
# Anti-Security
#Disable-ComputerRestore -Drive ${Env:SystemDrive}
#Disable-MicrosoftUpdate
#Update-ExecutionPolicy Unrestricted
Disable-MicrosoftUpdate
'@
If (-Not(Test-Path $ChocoFile)) {
$ChocoFileSettings | Out-File -FilePath $ChocoFile -Force
}
# Install Chocolatey & Boxstarter
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco feature enable -n allowGlobalConfirmation
choco install Boxstarter
Remove-Item 'C:\Users\Public\Desktop\Boxstarter Shell.lnk' -Force
$env:PSModulePath = $env:PSModulePath+";C:\ProgramData\Boxstarter"
Import-Module Boxstarter.Chocolatey
# Boxstarter/Chocolatey Provisioning
Install-BoxStarterPackage -PackageName $ChocoFile -DisableReboots
# Remove AppX Packages
Get-AppxPackage -AllUsers | Remove-AppxPackage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment