Navcontainerhelper: Sort-AppFoldersByDependencies search for tag AppID

Created on 25 Nov 2019  路  4Comments  路  Source: microsoft/navcontainerhelper

I change my project to BC15.1 Al Version 4.1 and i had to change in de app.json the field appid to id in the dependencies.

the Sort-AppFoldersByDependencies function looks for appid.

`@@ -60,8 +60,8 @@ function Sort-AppFoldersByDependencies {
            AddAnApp -AnApp $dependentApp
        }
        else {
            if (-not ($script:unresolvedDependencies | Where-Object { $_ -and $_.AppId -eq $dependency.AppId })) {
                Write-Warning "Dependency $($dependency.appId):$($dependency.publisher.Replace('/',''))_$($dependency.name.Replace('/',''))_$($dependency.version)).app not found"
            if (-not ($script:unresolvedDependencies | Where-Object { $_ -and $_.AppId -eq $dependency.id })) {
                Write-Warning "Dependency $($dependency.id):$($dependency.publisher.Replace('/',''))_$($dependency.name.Replace('/',''))_$($dependency.version)).app not found"
                $script:unresolvedDependencies += @($dependency)
            }
        }
@@ -79,7 +79,7 @@ function Sort-AppFoldersByDependencies {
        ($folders[$_.id]).SubString($baseFolder.Length)
    }
    if ($unknownDependencies) {
        $unknownDependencies.value = @($script:unresolvedDependencies | ForEach-Object { if ($_) { "$($_.appId):$($_.publisher.Replace('/',''))_$($_.name.Replace('/',''))_$($_.version).app" } })
        $unknownDependencies.value = @($script:unresolvedDependencies | ForEach-Object { if ($_) { "$($_.id):$($_.publisher.Replace('/',''))_$($_.name.Replace('/',''))_$($_.version).app" } })
    }
}
Export-ModuleMember -Function Sort-AppFoldersByDependencies`
bug Fix Ready

All 4 comments

ill create a pullrequest

Pullrequest: https://github.com/microsoft/navcontainerhelper/pull/756 <-- not a good solution

Checked in this code to replace "id" with "appId" after reading the file.

            # replace id with appid
            if ($appJson.dependencies) {
                $appJson.dependencies = $appJson.dependencies | % {
                    if ($_.psobject.Members | where-object membertype -like 'noteproperty' | Where-Object name -eq "id") {
                        New-Object psobject -Property ([ordered]@{ "appId" = $_.id; "publisher" = $_.publisher; "name" = $_.name; "version" = $_.version })
                    }
                    else {
                        $_
                    }
                }
            }

Should be fixed in 0.6.4.20

Was this page helpful?
0 / 5 - 0 ratings