From d95ba9823d258b2e8aa8b2684eef6f922fda6c05 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sun, 24 Nov 2024 21:14:55 +0100 Subject: [PATCH] add chocolatey installation module --- install_windows.ps1 | 2 ++ util/chocolatey.list | 10 ++++++++++ util/chocolatey.psm1 | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 util/chocolatey.list create mode 100644 util/chocolatey.psm1 diff --git a/install_windows.ps1 b/install_windows.ps1 index 2200b8e..6ae4346 100644 --- a/install_windows.ps1 +++ b/install_windows.ps1 @@ -1,9 +1,11 @@ +Import-Module ./util/chocolatey.psm1 Import-Module ./util/windows.psm1 Import-Module ./util/winget.psm1 # (Optionally) Install required Software InstallWinget +InstallChocolatey # Define paths for tools and configurations $dotfilesRepo = "$env:TMP\dotfiles" diff --git a/util/chocolatey.list b/util/chocolatey.list new file mode 100644 index 0000000..3ca5806 --- /dev/null +++ b/util/chocolatey.list @@ -0,0 +1,10 @@ +neovim +ripgrep +wget +curl +fd +unzip +gzip +mingw +make +composer diff --git a/util/chocolatey.psm1 b/util/chocolatey.psm1 new file mode 100644 index 0000000..118ebb5 --- /dev/null +++ b/util/chocolatey.psm1 @@ -0,0 +1,16 @@ +function InstallPackages +{ + choco.exe install (Get-Content ./util/chocolatey.list) +} + +function ChocolateyInstall +{ + $install = Read-Host "Install as Administrator now? [Y/n]" + if ($install.ToLower() -eq 'n') + { return + } + + # Start admin process, import this script, run 'InstallPackages' function + Start-Process powershell.exe -Verb RunAs ` + -ArgumentList "-C", "'Import-Module ./util/chocolatey.psm1; InstallPackages'" +}