Last active
May 7, 2025 08:08
-
-
Save iloire/f5abdbe28bfd29f8caf5c1aa53ed4976 to your computer and use it in GitHub Desktop.
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
| # Instructions to run this Boxstarter script: | |
| # 1. Save this script as Boxstarter-DevTools.ps1 on your Windows VM or upload it to a public/secret GitHub Gist and get the raw URL. | |
| # 2. Open an elevated PowerShell prompt (Run as Administrator). | |
| # 3. Ensure Boxstarter is installed by running: choco install -y boxstarter | |
| # 4. Run the script using one of the following commands: | |
| # - Local file: Install-BoxstarterPackage -PackageName C:\Path\To\Boxstarter-DevTools.ps1 -DisableReboots | |
| # - Gist URL: Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/username/uniqueid/raw/Boxstarter-DevTools.ps1 -DisableReboots | |
| # 5. The -DisableReboots flag is optional; remove it to allow Boxstarter to handle reboots automatically. | |
| # 6. Monitor the installation; check $env:LocalAppData\Boxstarter\Boxstarter.log for errors if any package fails. | |
| # Ensure PowerShell execution policy allows script execution | |
| if ((Get-ExecutionPolicy -Scope CurrentUser) -eq 'Restricted') { | |
| Write-Host "Execution policy is Restricted. Setting to RemoteSigned for CurrentUser..." | |
| Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force | |
| } | |
| # Check if Boxstarter is installed; attempt to install if not | |
| if (-not (Get-Module -ListAvailable -Name Boxstarter.Chocolatey)) { | |
| Write-Host "Boxstarter not found. Installing Boxstarter via Chocolatey..." | |
| & choco install -y boxstarter | |
| Import-Module Boxstarter.Chocolatey | |
| } | |
| # Boxstarter script to install Visual Studio 2022 and related dev tools | |
| # Disable UAC to prevent prompts during installation | |
| Disable-UAC | |
| # Enable Windows features useful for development | |
| Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart | |
| Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart | |
| # Install Chocolatey packages that may require reboots first | |
| choco install -y visualstudio2022community | |
| choco install -y dotnetfx # .NET Framework for compatibility | |
| choco install -y dotnet-sdk # Latest .NET SDK | |
| # Install other development tools | |
| choco install -y git | |
| choco install -y github-desktop | |
| choco install -y sourcetree | |
| choco install -y nodejs-lts | |
| choco install -y python | |
| #choco install -y vscode | |
| choco install -y sql-server-management-studio | |
| choco install -y totalcommander | |
| choco install googlechrome | |
| # Install Windows updates | |
| Install-WindowsUpdate -AcceptEula -SuppressReboots | |
| # Cleanup and optimize | |
| Remove-Item -Recurse -Force "$env:temp\*" # Clean temp files | |
| choco install -y ccleaner | |
| ccleaner /AUTO | |
| # Re-enable UAC after installation | |
| Enable-UAC | |
| # Pin commonly used tools to the taskbar | |
| Install-ChocolateyPinnedTaskBarItem "$env:ProgramFiles\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" | |
| Install-ChocolateyPinnedTaskBarItem "$env:ProgramFiles (x86)\Microsoft VS Code\Code.exe" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment