Tests/ExternalSQL/test.ps1

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
$ErrorActionPreference = "Stop"
. (Join-Path $PSScriptRoot "..\..\NavContainerHelper.ps1")
. (Join-Path $PSScriptRoot "..\settings.ps1")

$txtPath = (Join-Path $PSScriptRoot "test.txt")

New-NavContainer -accept_eula `
                 -containerName server1 `
                 -imageName $imageName `
                 -Credential $credential `
                 -licenseFile $licenseFile `
                 -updateHosts `
                 -useSSL:$false `
                 -includeCSide `
                 -doNotExportObjectsToText

New-NavContainer -accept_eula `
                 -containerName server2 `
                 -imageName $imageName `
                 -Credential $credential `
                 -updateHosts `
                 -useSSL:$false `
                 -includeCSide `
                 -doNotExportObjectsToText `
                 -databaseServer server1 `
                 -databaseInstance SQLEXPRESS `
                 -databaseName CRONUS `
                 -databaseCredential $sqlCredential

New-NavContainer -accept_eula `
                 -containerName server3 `
                 -imageName $imageName `
                 -Credential $credential `
                 -updateHosts `
                 -useSSL:$false `
                 -includeCSide `
                 -doNotExportObjectsToText `
                 -databaseServer server1 `
                 -databaseInstance SQLEXPRESS `
                 -databaseName CRONUS `
                 -databaseCredential $sqlCredential `
                 -additionalParameters ("--env encryptionPassword=P@ssword1")

Import-ObjectsToNavContainer -containerName server3 -objectsFile $txtPath -sqlCredential $sqlCredential
Export-NavContainerObjects -containerName server3 -objectsFolder "C:\ProgramData\NavContainerHelper\Extensions\server3\Objects" -sqlCredential $sqlCredential

Remove-NavContainer -containerName server3
Remove-NavContainer -containerName server2
Remove-NavContainer -containerName server1