From c979737767622e804a249e3e17200e943195a839 Mon Sep 17 00:00:00 2001 From: Ryan Richter Date: Thu, 30 Apr 2026 15:26:33 -0400 Subject: [PATCH] (#315) Add Parameter to Allow Skipping ChocolateyGUI Installation --- scripts/ClientSetup.ps1 | 11 +++++++++-- scripts/Register-C4bEndpoint.ps1 | 11 ++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/scripts/ClientSetup.ps1 b/scripts/ClientSetup.ps1 index 3b0f6fa..363da97 100644 --- a/scripts/ClientSetup.ps1 +++ b/scripts/ClientSetup.ps1 @@ -74,11 +74,16 @@ param( [Hashtable[]] $AdditionalPackages, - # Allows for the addition of alternative sources after the base conifguration has been applied. + # Allows for the addition of alternative sources after the base configuration has been applied. # Can override base configuration with this parameter [Parameter()] [Hashtable[]] - $AdditionalSources + $AdditionalSources, + + # Allows for the skipping of ChocolateyGUI installation. + [Parameter()] + [Switch] + $SkipChocolateyGUI ) Set-ExecutionPolicy Bypass -Scope Process -Force @@ -162,8 +167,10 @@ choco upgrade chocolatey.extension --confirm --source="'ChocolateyInternal'" --n } ) +if (-not $SkipChocolateyGUI){ choco upgrade chocolateygui --confirm --source="'ChocolateyInternal'" --no-progress choco upgrade chocolateygui.extension --confirm --source="'ChocolateyInternal'" --no-progress +} choco upgrade chocolatey-agent --confirm --source="'ChocolateyInternal'" diff --git a/scripts/Register-C4bEndpoint.ps1 b/scripts/Register-C4bEndpoint.ps1 index 650f63f..7cfd410 100644 --- a/scripts/Register-C4bEndpoint.ps1 +++ b/scripts/Register-C4bEndpoint.ps1 @@ -7,7 +7,7 @@ Some endpoints may require a different set of features. The default installation will apply our _recommended_ configuration. However, you can override these defaults or enable/disable additional features by providing the `-AdditionalFeatures` parameter. - In this example we will disable the use of the background service so non-admin users cannot use Chocolatey (not recommended), and enable Gloabl Confirmation so you no longer need to pass -y when performing a package operation. + In this example we will disable the use of the background service so non-admin users cannot use Chocolatey (not recommended), and enable Global Confirmation so you no longer need to pass -y when performing a package operation. . .\Register-C4bEndpoint.ps1 -RepositoryCredential (Get-Credential) -AdditionalFeatures @{ useBackgroundService = 'Disabled'; allowGlobalCOnfirmation = 'Enabled' } @@ -93,7 +93,7 @@ Param( [Hashtable] $AdditionalConfiguration, - # Allows for the toggling of additonal features that is applied after the base configuration. + # Allows for the toggling of additional features that is applied after the base configuration. # Can override base configuration with this parameter [Parameter()] [Hashtable] @@ -104,12 +104,17 @@ Param( [Hashtable[]] $AdditionalPackages, - # Allows for the addition of alternative sources after the base conifguration has been applied. + # Allows for the addition of alternative sources after the base configuration has been applied. # Can override base configuration with this parameter [Parameter()] [Hashtable[]] $AdditionalSources, + # Allows for the skipping of ChocolateyGUI installation. + [Parameter()] + [Switch] + $SkipChocolateyGUI, + # If passed, downloads the certificate from the client server before initializing Chocolatey Agent [Parameter()] [Switch]