From 22146fc024da6c1d01f4d435686b8163bb43b2cc Mon Sep 17 00:00:00 2001 From: Parkreiner Date: Mon, 1 Jul 2024 21:12:27 +0000 Subject: [PATCH] wip: add deliberately broken code to script --- windows-rdp/powershell-installation-script.tftpl | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/windows-rdp/powershell-installation-script.tftpl b/windows-rdp/powershell-installation-script.tftpl index 1b7ab48..d39ee24 100644 --- a/windows-rdp/powershell-installation-script.tftpl +++ b/windows-rdp/powershell-installation-script.tftpl @@ -23,19 +23,9 @@ function Install-DevolutionsGateway { $moduleName = "DevolutionsGateway" $moduleVersion = "2024.1.5" -# Install the module with the specified version for all users -# This requires administrator privileges -try { - # Install-PackageProvider is required for AWS. Need to set command to - # terminate on failure so that try/catch actually triggers - Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -ErrorAction Stop - Install-Module -Name $moduleName -RequiredVersion $moduleVersion -Force -} -catch { - # If the first command failed, assume that we're on GCP and run - # Install-Module only - Install-Module -Name $moduleName -RequiredVersion $moduleVersion -Force -} +# This should always fail on GCP +Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -ErrorAction Stop +Install-Module -Name $moduleName -RequiredVersion $moduleVersion -Force # Construct the module path for system-wide installation $moduleBasePath = "C:\Windows\system32\config\systemprofile\Documents\PowerShell\Modules\$moduleName\$moduleVersion"