From 4ab72575ac048a93f3c8854f3a41b936830fab73 Mon Sep 17 00:00:00 2001 From: Parkreiner Date: Fri, 28 Jun 2024 17:23:58 +0000 Subject: [PATCH] fix: remove accidental uncaught code --- windows-rdp/main.tf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/windows-rdp/main.tf b/windows-rdp/main.tf index 09622a7..eaac9cb 100644 --- a/windows-rdp/main.tf +++ b/windows-rdp/main.tf @@ -63,13 +63,14 @@ resource "coder_script" "windows-rdp" { # Install the module with the specified version for all users # This requires administrator privileges try { + # Install-PackageProvider is required for AWS Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force 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 } - Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force - 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"