Compare commits
2 Commits
main
...
web-rdp-cl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb075aa035 | ||
|
|
9864408643 |
@@ -60,9 +60,13 @@ resource "coder_script" "windows-rdp" {
|
||||
$moduleName = "DevolutionsGateway"
|
||||
$moduleVersion = "2024.1.5"
|
||||
|
||||
# Install the module with the specified version for all users
|
||||
# This requires administrator privileges
|
||||
Install-Module -Name $moduleName -RequiredVersion $moduleVersion -Force
|
||||
Install-Module -Name $moduleName -RequiredVersion $moduleVersion -Force -Confirm:$false -SkipPublisherCheck
|
||||
|
||||
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
|
||||
$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-Module $modulePath
|
||||
}
|
||||
|
||||
Install-DGatewayPackage
|
||||
|
||||
# Configure Devolutions Gateway
|
||||
|
||||
Reference in New Issue
Block a user