Created
October 1, 2020 20:20
-
-
Save aspen-roller/1ac6e50c7b09c0f850f7fd1c4b4a572c to your computer and use it in GitHub Desktop.
Chocolatey install packages
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
$chocolateyAppList = "googlechrome,firefox,redis-64,7zip,dotnetcore-sdk,dotnetcore-windowshosting" | |
$dismAppList = "IIS-ASPNET45,IIS-CertProvider,IIS-ManagementService" | |
Invoke-Expression "InstallApps.ps1 ""$chocolateyAppList"" ""$dismAppList""" |
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
# https://octopus.com/blog/automate-developer-machine-setup-with-chocolatey | |
Param( | |
[string]$chocolateyAppList, | |
[string]$dismAppList | |
) | |
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($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 | |
} | |
} | |
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 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment