Skip to content

Instantly share code, notes, and snippets.

@sidusnare
Created May 14, 2022 00:05
Show Gist options
  • Save sidusnare/acfcf9afa1ecb61c2bc4802fdb6c639a to your computer and use it in GitHub Desktop.
Save sidusnare/acfcf9afa1ecb61c2bc4802fdb6c639a to your computer and use it in GitHub Desktop.
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n allowGlobalConfirmation
choco feature enable -n allowEmptyChecksums
choco config set --name cacheLocation --value ${env:SYSTEMDRIVE}\sidusconfig\cache
$fail = @()
$sucsess = @()
$file = Get-Content -Path "${env:SYSTEMDRIVE}\sidusconfig\first.json" -Raw
$packages = ConvertFrom-Json $file
$file = Get-Content -Path "${env:SYSTEMDRIVE}\sidusconfig\second.json" -Raw
$packages += ConvertFrom-Json $file
$file = Get-Content -Path "${env:SYSTEMDRIVE}\sidusconfig\dev.json" -Raw
$packages += ConvertFrom-Json $file
$file = Get-Content -Path "${env:SYSTEMDRIVE}\sidusconfig\workstation.json" -Raw
$packages += ConvertFrom-Json $file
$file = Get-Content -Path "${env:SYSTEMDRIVE}\sidusconfig\game.json" -Raw
$packages += ConvertFrom-Json $file
foreach ($p in $packages) {
echo "Installing: $p"
choco install --no-progress $p -y
$chocclso = $lastExitCode
if ( $choco -gt 0 ) {
$fail += $p
} else {
$sucsess += $p
}
}
$fail | ConvertTo-Json | Add-Content -Path "${env:SYSTEMDRIVE}\sidusconfig\fail.json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment