-
-
Save zaccb/f57988424df89a35f4dab9fc8b789685 to your computer and use it in GitHub Desktop.
:: Install choco .exe and add choco to PATH | |
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
:: Install all the packages | |
:::: Browsers | |
choco install googlechrome -fy | |
choco install firefox -fy | |
:::: Text editors / IDEs | |
choco install atom -fy | |
choco install sublimetext3 -fy | |
choco install visualstudiocode -fy | |
choco install visualstudio2015community -fy | |
:::: Dev tools | |
choco install git -fy | |
choco install nodejs.install -fy | |
:::: Media | |
choco install vlc -fy | |
:::: Utilities + other | |
choco install 7zip.install -fy | |
choco install dropbox -fy | |
choco install slack -fy | |
choco install office365proplus -fy |
Great stuff!
Is there a way to install VM in hyper-v using this? so I don't want to go thru the OS setup process. I want to install OS in VM and also install all packages.
Thank you very much for the script.
For people who are lazy like me:
Create an extra file packages.txt in the same folder with content like
# browsers
googlechrome
firefox
# Text editors / IDEs
sublimetext3
...
And replace all choco install calls with
for /F "eol=#" %%G in (packages.txt) do choco install %%G -fy
Lines prefixed with # will be excluded automatically.
This reduces the typing work while preserving the ability to easily remove packages.
Using upgrade also installs. The following can be run at will to install on a fresh system or upgrade packages on existing.
`@echo off
echo Administrative permissions required. Detecting permissions ...
net session >nul 2>&1
if %errorLevel% == 0 (
ECHO Okay ...
IF EXIST "C:\ProgramData\chocolatey\bin\chocolatey.exe" (
ECHO Chocolatey is already installed ...
choco upgrade chocolatey chocolatey-core.extension -y
) ELSE (
ECHO Installing Chocolatey ...
@PowerShell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
)
ECHO Checking packages ...
for /F "eol=#" %%G in (packages.txt) do choco upgrade %%G -y
) else (
echo Failure: Current permissions inadequate.
)`
packages.txt:
package_1
package_2
package_3
#ignored_package_4
package_5
@Wisedemic Glad that you found it helpful! I had to spin up a new VM this morning for a dev environment and used this again - still works! Generates a few warnings, but nothing blocking. There's a lot of other config that can be easily added to this with @PowerShell, depending on how you have your box setup.