From 16f96d3693571edab9847e3d0666e75b1312acec Mon Sep 17 00:00:00 2001 From: Parkreiner Date: Fri, 28 Jun 2024 17:49:55 +0000 Subject: [PATCH] wip: add code for triggering try/catch --- 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 8e52088..273ad20 100644 --- a/windows-rdp/main.tf +++ b/windows-rdp/main.tf @@ -63,8 +63,9 @@ 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-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 {