Skip to content

Instantly share code, notes, and snippets.

@TotallyNotEmilio
Created June 23, 2021 05:18
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 TotallyNotEmilio/e59e80886115ae065d249aa458b1ea04 to your computer and use it in GitHub Desktop.
Save TotallyNotEmilio/e59e80886115ae065d249aa458b1ea04 to your computer and use it in GitHub Desktop.
$testchoco = powershell choco -v
if(-not($testchoco)){
Write-Output "Seems Chocolatey is not installed, installing now"
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
}
else{
Write-Output "Chocolatey Version $testchoco is already installed"
}
$Packages = 'googlechrome', 'winrar', 'notepadplusplus', 'microsoft-teams', 'nordvpn', 'spotify', 'steam-client', 'discord'
ForEach ($PackageName in $Packages)
$PackageNameInstalled = $false if (Get-Command $PackageName.exe -ErrorAction SilentlyContinue) {
Write-Output "Seems $PackageName is not installed, installing now"
choco install $PackageName -y
}
Else ($PackageNameInstalled = $true)
{
Write-Output "$PackageName is already installed"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment