Skip to content

Commit 16f96d3

Browse files
committed
wip: add code for triggering try/catch
1 parent 8262b29 commit 16f96d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

windows-rdp/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ resource "coder_script" "windows-rdp" {
6363
# Install the module with the specified version for all users
6464
# This requires administrator privileges
6565
try {
66-
# Install-PackageProvider is required for AWS
67-
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
66+
# Install-PackageProvider is required for AWS. Need to set command to
67+
# terminate on failure so that try/catch actually triggers
68+
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -ErrorAction Stop
6869
Install-Module -Name $moduleName -RequiredVersion $moduleVersion -Force
6970
}
7071
catch {

0 commit comments

Comments
 (0)