Last active
March 10, 2022 22:48
-
-
Save arag0re/aca0f726079945c500d5810bdb5075da to your computer and use it in GitHub Desktop.
Standart Install with Chocolatey
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
## You need to start Powershell as Admin for this!!! | |
### WARNING: First you have to set the execution policy for powershell scripts on this system to "Set-ExecutionPolicy unrestricted" | |
### after executing this script change it back to "Set-ExecutionPolicy allSigned" (may have to restart powershell for this) | |
$Packages = 'googlechrome', | |
"firefox", | |
"notepadplusplus", | |
"7zip", | |
"openjdk8", | |
"openjdk11", | |
"office-tool", | |
"choco-cleaner" | |
If(Test-Path -Path "$env:ProgramData\Chocolatey") { | |
# DoYourPackageInstallStuff | |
ForEach ($PackageName in $Packages) | |
{ | |
choco install $PackageName -y | |
} | |
} | |
Else { | |
# InstallChoco | |
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
# DoYourPackageInstallStuff | |
ForEach ($PackageName in $Packages) | |
{ | |
choco install $PackageName -y | |
} | |
} | |
choco-cleaner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
<3