generated from Ed-Fi-Exchange-OSS/Template-for-GitHub
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathInstallEPPPowerBIStarterKitMSSQLViews.ps1
59 lines (49 loc) · 2.32 KB
/
InstallEPPPowerBIStarterKitMSSQLViews.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
51
52
53
54
55
56
57
58
59
# Folder path to the views directory
$viewsFolderPath = "./"
$dataStandardFolder = "ds-4.0"
# SQL Server and database
$server = "."
$database = "EdFi_ODS"
# SQL Server username and password (if not using trusted connection)
$username = ""
$password = ""
# For local installations with untrusted self-signed certificates, set
# $encrypt to "false". When connecting to a remote server with a trusted
# certificate, set to "true".
$encrypt="false"
# NOTE - following connectionString parameters do not attempt to cover every possible connection string configuration.
# Instead, they are intended to be sufficient for simple scenarios and a starting point for more complicated configuration.
# Uncomment the connection string that you wish to use
# For trusted connection use the following
$connectionString = "server=$server;trusted_connection=True;database=$database;encrypt=$encrypt"
# If connecting to SQL Server with username and password, use the following connection string
# $connectionString = "server=$server;user id=$username; password=$password;database=$database;"
# Relative path that corresponds to the folder containing the scripts for your needed data standard
$baseFolder = "Base/MSSQL"
$rlsFolder = "RLS/MSSQL"
$eppFolder = "EPP/MSSQL"
$dataStandardFolderPath = Join-Path -Path $viewsFolderPath -ChildPath $dataStandardFolder
$baseFolderPath = Join-Path -Path $dataStandardFolderPath -ChildPath $baseFolder
$rlsFolderPath = Join-Path -Path $dataStandardFolderPath -ChildPath $rlsFolder
$eppFolderPath = Join-Path -Path $dataStandardFolderPath -ChildPath $eppFolder
$files = Get-ChildItem -Path $baseFolderPath
# Iterate through each file in the data standard folder that you wish to use
foreach ($file in $files)
{
WRITE-HOST $file.FullName
Invoke-Sqlcmd -InputFile $file.FullName -ConnectionString $connectionString
}
$files = Get-ChildItem -Path $rlsFolderPath
# Iterate through each file in the data standard folder that you wish to use
foreach ($file in $files)
{
WRITE-HOST $file.FullName
Invoke-Sqlcmd -InputFile $file.FullName -ConnectionString $connectionString
}
$files = Get-ChildItem -Path $eppFolderPath
# Iterate through each file in the data standard folder that you wish to use
foreach ($file in $files)
{
WRITE-HOST $file.FullName
Invoke-Sqlcmd -InputFile $file.FullName -ConnectionString $connectionString
}