I use Chocolatey (chocolatey.org) as my source of software installation and would like to know if it is possible to run a Powershell script to install chocolatey (and maybe the software I need) during the post setup. Normally you run the following command in Powershell to install Chocolatey
After that you can install software via the powershell with
for example.
You can even automatically confirm every installation aka silent install with
to skip the "Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint):" during the installation.
So, my thoughts are to include three scripts:
1) Install Chocolatey
2) Allow auto-confirm every installation
3) Including the installation command for all the software I need
The problems I have so far are:
1) I have no clue how to write a powershell script (Can I simply put the code above in a file and save it as powershell script?)
2) Chocolatey needs to run in administrative shell to work. Is this somehow possible during post-setup?
Maybe you can point me in the right direction to make this work.
Code:
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'))
After that you can install software via the powershell with
Code:
choco install adobereader
You can even automatically confirm every installation aka silent install with
Code:
choco feature enable -n allowGlobalConfirmation
So, my thoughts are to include three scripts:
1) Install Chocolatey
2) Allow auto-confirm every installation
3) Including the installation command for all the software I need
The problems I have so far are:
1) I have no clue how to write a powershell script (Can I simply put the code above in a file and save it as powershell script?)
2) Chocolatey needs to run in administrative shell to work. Is this somehow possible during post-setup?
Maybe you can point me in the right direction to make this work.