| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -60,19 +60,9 @@ 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
 | 
					 | 
					 | 
					 | 
					    # This should cause Google Cloud to break (doing this on purpose)
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # This requires administrator privileges
 | 
					 | 
					 | 
					 | 
					    Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -ErrorAction Stop
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    try {
 | 
					 | 
					 | 
					 | 
					    Install-Module -Name $moduleName -RequiredVersion $moduleVersion -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 {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      # If the first command failed, assume that we're on GCP and run
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      # Install-Module only
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      Install-Module -Name $moduleName -RequiredVersion $moduleVersion -Force
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # 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"
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |