$chocolateyAppList = "microsoft-windows-terminal,microsoft-edge,7zip,vscode" 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 } }