forked from RuiRomano/pbidevops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.ps1
48 lines (37 loc) · 1.14 KB
/
deploy.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
#Requires -Modules @{ ModuleName="MicrosoftPowerBIMgmt"; ModuleVersion="1.2.1026" }
param(
[string]$path = ".\SampleProject"
,
[string]$configPath = ".\config-prd.json"
,
[bool]$workspaces = $true
,
[bool]$datasets = $true
,
[bool]$reports = $true
,
[bool]$paginatedReports = $false
)
# Install-Module MicrosoftPowerBIMgmt -MinimumVersion 1.2.1026
$VerbosePreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"
$currentPath = (Split-Path $MyInvocation.MyCommand.Definition –Parent)
Import-Module "$currentPath\Modules\PBIDevOps" -Force
Connect-PowerBIServiceAccount
if ($workspaces)
{
Publish-PBIWorkspaces -configPath $configPath
}
if ($datasets)
{
Publish-PBIDataSets -configPath $configPath -path "$path\DataSets"
}
if ($reports)
{
# README - The live connected PBIX reports need to be binded to an existent Dataset on powerbi.com - Run tool.FixReportConnections.ps1 to fix the pbix connections
Publish-PBIReports -configPath $configPath -path "$path\Reports"
}
if ($paginatedReports)
{
Publish-PBIReports -configPath $configPath -path "$path\PaginatedReports"
}