wip: add code for triggering try/catch
This commit is contained in:
@@ -63,8 +63,9 @@ resource "coder_script" "windows-rdp" {
|
|||||||
# Install the module with the specified version for all users
|
# Install the module with the specified version for all users
|
||||||
# This requires administrator privileges
|
# This requires administrator privileges
|
||||||
try {
|
try {
|
||||||
# Install-PackageProvider is required for AWS
|
# Install-PackageProvider is required for AWS. Need to set command to
|
||||||
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
|
# 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
|
Install-Module -Name $moduleName -RequiredVersion $moduleVersion -Force
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user