Skip to content

Instantly share code, notes, and snippets.

@ihilt
Last active January 10, 2020 13:27
Show Gist options
  • Select an option

  • Save ihilt/fc05090fe8b70b859a45f76aef1fd7fb to your computer and use it in GitHub Desktop.

Select an option

Save ihilt/fc05090fe8b70b859a45f76aef1fd7fb to your computer and use it in GitHub Desktop.
chocolately script
$chocolateyAppList = "everything,googlechrome,sql-server-management-studio,greenshot,wavebox,vscode,7zip,1password,vlc,git,php,wireshark,composer,filezilla,visualstudio2019community,python2,powerbi,wsl,wsl-ubuntu-1804,winscp,winmerge,sql-server-2019,r,r.studio,rtools,dejavufonts,dotnetcore,postman"
if ([string]::IsNullOrWhiteSpace($chocolateyAppList) -eq $false -or [string]::IsNullOrWhiteSpace($dismAppList) -eq $false)
{
try{
choco config get cacheLocation
}catch{
Write-Output "Chocolatey not detected, trying to install now"
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
}
}
if ([string]::IsNullOrWhiteSpace($dismAppList) -eq $false){
Write-Host "DISM Features Specified"
$appsToInstall = $dismAppList -split "," | foreach { "$($_.Trim())" }
foreach ($app in $appsToInstall)
{
Write-Host "Installing $app"
& choco install $app /y /source windowsfeatures | Write-Output
}
}
if ([string]::IsNullOrWhiteSpace($chocolateyAppList) -eq $false){
Write-Host "Chocolatey Apps Specified"
$appsToInstall = $chocolateyAppList -split "," | foreach { "$($_.Trim())" }
foreach ($app in $appsToInstall)
{
Write-Host "Installing $app"
& choco install $app /y | Write-Output
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment