preserver version of definition.pbir

This commit is contained in:
RuiRomano 2024-06-12 09:54:22 +01:00
Родитель 942285ec9d
Коммит 2adc0a0ba9
1 изменённых файлов: 54 добавлений и 28 удалений

Просмотреть файл

@ -131,7 +131,6 @@ Function Invoke-FabricAPIRequest {
[Parameter(Mandatory = $false)] [string] $contentType = "application/json; charset=utf-8", [Parameter(Mandatory = $false)] [string] $contentType = "application/json; charset=utf-8",
[Parameter(Mandatory = $false)] [int] $timeoutSec = 240, [Parameter(Mandatory = $false)] [int] $timeoutSec = 240,
[Parameter(Mandatory = $false)] [int] $retryCount = 0 [Parameter(Mandatory = $false)] [int] $retryCount = 0
) )
if ([string]::IsNullOrEmpty($authToken)) { if ([string]::IsNullOrEmpty($authToken)) {
@ -721,13 +720,13 @@ Function Import-FabricItems {
if ($datasetReference) if ($datasetReference)
{ {
$datasetName = $datasetReference.name # $datasetName = $datasetReference.name
$datasetId = $datasetReference.id $datasetId = $datasetReference.id
$newPBIR = @{ $pbirJson.datasetReference.byPath = $null
"version" = "1.0"
"datasetReference" = @{ $pbirJson.datasetReference.byConnection = @{
"byConnection" = @{
"connectionString" = $null "connectionString" = $null
"pbiServiceModelId" = $null "pbiServiceModelId" = $null
"pbiModelVirtualServerName" = "sobe_wowvirtualserver" "pbiModelVirtualServerName" = "sobe_wowvirtualserver"
@ -735,8 +734,22 @@ Function Import-FabricItems {
"name" = "EntityDataSource" "name" = "EntityDataSource"
"connectionType" = "pbiServiceXmlaStyleLive" "connectionType" = "pbiServiceXmlaStyleLive"
} }
}
} | ConvertTo-Json $newPBIR = $pbirJson | ConvertTo-Json
# $newPBIR = @{
# "version" = "1.0"
# "datasetReference" = @{
# "byConnection" = @{
# "connectionString" = $null
# "pbiServiceModelId" = $null
# "pbiModelVirtualServerName" = "sobe_wowvirtualserver"
# "pbiModelDatabaseName" = "$datasetId"
# "name" = "EntityDataSource"
# "connectionType" = "pbiServiceXmlaStyleLive"
# }
# }
# } | ConvertTo-Json
$fileContent = [system.Text.Encoding]::UTF8.GetBytes($newPBIR) $fileContent = [system.Text.Encoding]::UTF8.GetBytes($newPBIR)
@ -951,10 +964,9 @@ Function Import-FabricItem {
throw "Cannot import directly a report using byPath connection. You must first resolve the semantic model id and pass it through the 'itemProperties' parameter." throw "Cannot import directly a report using byPath connection. You must first resolve the semantic model id and pass it through the 'itemProperties' parameter."
} }
$newPBIR = @{ $pbirJson.datasetReference.byPath = $null
"version" = "1.0"
"datasetReference" = @{ $pbirJson.datasetReference.byConnection = @{
"byConnection" = @{
"connectionString" = $null "connectionString" = $null
"pbiServiceModelId" = $null "pbiServiceModelId" = $null
"pbiModelVirtualServerName" = "sobe_wowvirtualserver" "pbiModelVirtualServerName" = "sobe_wowvirtualserver"
@ -962,8 +974,22 @@ Function Import-FabricItem {
"name" = "EntityDataSource" "name" = "EntityDataSource"
"connectionType" = "pbiServiceXmlaStyleLive" "connectionType" = "pbiServiceXmlaStyleLive"
} }
}
} | ConvertTo-Json $newPBIR = $pbirJson | ConvertTo-Json
# $newPBIR = @{
# "version" = "1.0"
# "datasetReference" = @{
# "byConnection" = @{
# "connectionString" = $null
# "pbiServiceModelId" = $null
# "pbiModelVirtualServerName" = "sobe_wowvirtualserver"
# "pbiModelDatabaseName" = "$datasetId"
# "name" = "EntityDataSource"
# "connectionType" = "pbiServiceXmlaStyleLive"
# }
# }
# } | ConvertTo-Json
$fileContent = [system.Text.Encoding]::UTF8.GetBytes($newPBIR) $fileContent = [system.Text.Encoding]::UTF8.GetBytes($newPBIR)
} }