|
|
@ -60,9 +60,13 @@ resource "coder_script" "windows-rdp" {
|
|
|
|
$moduleName = "DevolutionsGateway"
|
|
|
|
$moduleName = "DevolutionsGateway"
|
|
|
|
$moduleVersion = "2024.1.5"
|
|
|
|
$moduleVersion = "2024.1.5"
|
|
|
|
|
|
|
|
|
|
|
|
# Install the module with the specified version for all users
|
|
|
|
Install-Module -Name $moduleName -RequiredVersion $moduleVersion -Force -Confirm:$false -SkipPublisherCheck
|
|
|
|
# This requires administrator privileges
|
|
|
|
|
|
|
|
Install-Module -Name $moduleName -RequiredVersion $moduleVersion -Force
|
|
|
|
try {
|
|
|
|
|
|
|
|
# Try to import the module directly
|
|
|
|
|
|
|
|
Import-Module $moduleName -ErrorAction Stop
|
|
|
|
|
|
|
|
} catch {
|
|
|
|
|
|
|
|
# If it fails, install and then import the module
|
|
|
|
|
|
|
|
|
|
|
|
# Construct the module path for system-wide installation
|
|
|
|
# Construct the module path for system-wide installation
|
|
|
|
$moduleBasePath = "C:\Windows\system32\config\systemprofile\Documents\PowerShell\Modules\$moduleName\$moduleVersion"
|
|
|
|
$moduleBasePath = "C:\Windows\system32\config\systemprofile\Documents\PowerShell\Modules\$moduleName\$moduleVersion"
|
|
|
@ -70,6 +74,8 @@ resource "coder_script" "windows-rdp" {
|
|
|
|
|
|
|
|
|
|
|
|
# Import the module using the full path
|
|
|
|
# Import the module using the full path
|
|
|
|
Import-Module $modulePath
|
|
|
|
Import-Module $modulePath
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Install-DGatewayPackage
|
|
|
|
Install-DGatewayPackage
|
|
|
|
|
|
|
|
|
|
|
|
# Configure Devolutions Gateway
|
|
|
|
# Configure Devolutions Gateway
|
|
|
|