Fix missing item.metadata.json (#254)

With the latest version of PowerBI the file 'item.metadata.json'
was replace with a file called '.platform'

This also means we need to update the:

=Microsoft.AnalysisServices.NetCore.retail.amd64=

to version 19.77
This commit is contained in:
Lobo 2024-04-01 15:46:51 +01:00 коммит произвёл GitHub
Родитель 38355c12b2
Коммит dce5deb425
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 9 добавлений и 13 удалений

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

@ -10,7 +10,7 @@ $nugets = @(
@{
name = "Microsoft.AnalysisServices.NetCore.retail.amd64"
;
version = "19.72.0"
version = "19.77.0"
;
path = @(
"lib\netcoreapp3.0\Microsoft.AnalysisServices.Core.dll"
@ -629,33 +629,29 @@ Function Import-FabricItems {
$files = $files | ? { $_.Name -notlike "item.*.json" -and $_.Name -notlike "*.abf" -and $_.Directory.Name -notlike ".pbi" }
# There must be a item.metadata.json in the item folder containing the item type and displayname, necessary for the item creation
# There must be a .platform in the item folder containing the item type and displayname, necessary for the item creation
$itemMetadataStr = Get-Content "$itemPath\.platform"
$itemMetadataStr = Get-Content "$itemPath\item.metadata.json"
$fileOverrideMatch = $null
if ($fileOverridesEncoded)
{
$fileOverrideMatch = $fileOverridesEncoded |? { "$itemPath\item.metadata.json" -ilike $_.Name } | select -First 1
$fileOverrideMatch = $fileOverridesEncoded |? { "$itemPath\.platform" -ilike $_.Name } | select -First 1
if ($fileOverrideMatch) {
Write-Host "File override 'item.metadata.json'"
Write-Host "File override '.platform'"
$itemMetadataStr = [System.Text.Encoding]::UTF8.GetString($fileOverrideMatch.Value)
}
}
$itemMetadata = $itemMetadataStr | ConvertFrom-Json
$itemType = $itemMetadata.type
$itemType = $itemMetadata.metadata.type
if ($itemType -ieq "dataset")
{
$itemType = "SemanticModel"
}
$displayName = $itemMetadata.displayName
$displayName = $itemMetadata.metadata.displayName
$itemPathAbs = Resolve-Path $itemPath