DSCResources/SharedPersist/SharedPersist.schema.psm1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
Configuration SharedPersist { param ( [string] $SharedRoot, [string] $SenseInstallPath = "$($env:ProgramFiles)\Qlik\Sense", [string] $DBHost, [int] $DBPort = 4432, [PSCredential] $DBPassword ) Import-DSCResource -ModuleName xNetworking,xSmbShare if ($IsCentral) { if (Test-Path "$($env:ProgramData)\Qlik\Sense\Apps") { File SharedApps { Ensure = "Present" Type = "Directory" SourcePath = "$($env:ProgramData)\Qlik\Sense\SharedPersistence\Apps" DestinationPath = "$SharedRoot\Apps" Recurse = $true } } #File CustomData #{ # Ensure = "Present" # Type = "Directory" # SourcePath = "$($env:ProgramData)\Qlik\Sense\Custom Data" # DestinationPath = "$SharedRoot\Custom Data" #} File Connectors { Ensure = "Present" Type = "Directory" SourcePath = "$($env:ProgramFiles)\Common Files\Qlik\Custom Data" DestinationPath = "$SharedRoot\Custom Data" Recurse = $true } if (Test-Path "$($env:ProgramData)\Qlik\Sense\Repository\AppContent") { File AppContent { Ensure = "Present" Type = "Directory" SourcePath = "$($env:ProgramData)\Qlik\Sense\Repository\AppContent" DestinationPath = "$SharedRoot\StaticContent\AppContent" Recurse = $true } } if (Test-Path "$($env:ProgramData)\Qlik\Sense\Repository\Content") { File Content { Ensure = "Present" Type = "Directory" SourcePath = "$($env:ProgramData)\Qlik\Sense\Repository\Content" DestinationPath = "$SharedRoot\StaticContent\Content" Recurse = $true } } File DefaultContent { Ensure = "Present" Type = "Directory" SourcePath = "$($env:ProgramData)\Qlik\Sense\Repository\DefaultContent" DestinationPath = "$SharedRoot\StaticContent\DefaultContent" Recurse = $true } if (Test-Path "$($env:ProgramData)\Qlik\Sense\Repository\Extensions") { File Extensions { Ensure = "Present" Type = "Directory" SourcePath = "$($env:ProgramData)\Qlik\Sense\Repository\Extensions" DestinationPath = "$SharedRoot\StaticContent\Extensions" Recurse = $true } } if (Test-Path "$($env:ProgramData)\Qlik\Sense\Repository\Archived Logs") { File ArchivedLogs { Ensure = "Present" Type = "Directory" SourcePath = "$($env:ProgramData)\Qlik\Sense\Repository\Archived Logs" DestinationPath = "$SharedRoot\ArchivedLogs" Recurse = $true } } } ConfigFile repository { Ensure = "Present" configPath = "$SenseInstallPath\Repository\Repository.exe.config" appSettings = @{ SharedPersistence = 'true' } } EncryptConfig repository { exePath = "$SenseInstallPath\Repository\Repository.exe" configSection = "connectionStrings" connectionString = "User ID=postgres;Host=$DBHost;Password=$($DBPassword.GetNetworkCredential().Password);Port=$DBPort;Database=QSR;Pooling=true;Min Pool Size=0;Max Pool Size=90;Connection Lifetime=3600;Unicode=true;" Ensure = "Present" } } |