Skip to content

Instantly share code, notes, and snippets.

@SteveStrong
Created February 5, 2020 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveStrong/385155270f681cd332b951ceec13889f to your computer and use it in GitHub Desktop.
Save SteveStrong/385155270f681cd332b951ceec13889f to your computer and use it in GitHub Desktop.
workstation setup
@ECHO OFF
echo Administrative permissions required. Detecting permissions...
net session >nul 2>&1
if %errorLevel% == 0 (
echo Success: Administrative permissions confirmed.
) else (
echo Failure: Current permissions inadequate.
pause >nul
exit
)
where /q choco
IF ERRORLEVEL 1 (
ECHO The choco is missing.
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
) ELSE (
ECHO choco exists. Let's go!
)
echo getting the versions of applications installed by choco...
:: choco upgrade all --noop > choco-versions.txt
choco list -local-only > choco-versions.txt
REM requires an external file
REM hard to coordinate and little value with other platforms
REM for /f "tokens=1-2 delims=," %%i in (tool-suite.txt) do (
REM Call :InstallIf %%i , %%j
REM )
Call :InstallIf openjdk11 , 11.0.5.10
Call :InstallIf awscli , 1.17.3
Call :InstallIf chefdk , 4.6.35
:: Call :InstallIf docker-cli , 18.09.6
Call :InstallIf docker-toolbox , 19.03.1
:: Call :InstallIf docker-machine , 0.16.1
Call :InstallIf git , 2.25.0
Call :InstallIf gitflow-avh , 0.0.0
Call :InstallIf googlechrome , 79.0.3945.117
Call :InstallIf havdetectiontool , 1.0
:: Call :InstallIf inspec ,4.7.18
Call :InstallIf jhipster ,5.8.2
Call :InstallIf kubernetes-cli , 1.17.1
Call :InstallIf kubernetes-helm , 3.0.2
Call :InstallIf make , 4.2.1
Call :InstallIf maven , 3.6.3
Call :InstallIf microsoft-windows-terminal , 0.8.10091.0
Call :InstallIf minikube , 1.6.2
Call :InstallIf mobaxterm , 11.1.0
Call :InstallIf nodejs , 12.14.1
:: Call ?:InstallIf openjdk , 11.0.2.01
Call :InstallIf postman , 7.2.2
Call :InstallIf python , 3.7.6
Call :InstallIf selenium-chrome-driver , 75.0.3770.8
Call :InstallIf springtoolsuite , 3.9.6
Call :InstallIf terraform , 0.12.5
Call :InstallIf vagrant , 2.2.5
Call :InstallIf virtualbox , 6.1.2
Call :InstallIf vscode , 1.41.1
Call :InstallIf wsl , 1.0.1
refreshenv
REM VS Code plugins from https://marketplace.visualstudio.com/VSCode
code --install-extension redhat.java
code --install-extension SonarSource.sonarlint-vscode
REM code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools
REM code --install-extension ms-azuretools.vscode-docker
REM code --install-extention cameronsonatype.vscode-extension-nexus-iq
REM code --install-extention Pivotal.vscode-boot-dev-pack
npm install -g @angular/cli
docker-machine create --driver virtualbox default
docker-machine env
@FOR /f "tokens=*" %%i IN ('docker-machine env') DO @%%i
echo
echo space setup complete!
echo
:: refreshenv exits the script
GOTO End
:: Functions
:InstallIf
echo looking for "%~1 %~2"
findstr /I /C:"%~1 %~2" choco-versions.txt
if %errorlevel% EQU 0 (
echo Found %~1 %~2
) else (
echo installing %~1 %~2
choco upgrade -y %~1 --version %~2
echo installed %~1 %~2
)
EXIT /B 0
:End
REM refreshenv
EXIT /B n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment