* Support sub directory for artifact location * Fix as per review comment to avoid artifact sub path * Package property file is not created for track1 and management pacakges. * Fix property name case * Fix as per review comments * Fix as per review comments * Use Config File param value as is * Change to make path joineasily readable Co-authored-by: praveenkuttappan <prmarott@microsoft.com>
35 lines
967 B
PowerShell
35 lines
967 B
PowerShell
[CmdletBinding()]
|
|
Param (
|
|
[Parameter(Mandatory=$True)]
|
|
[string] $serviceDirectory,
|
|
[Parameter(Mandatory=$True)]
|
|
[string] $outDirectory
|
|
)
|
|
|
|
. (Join-Path $PSScriptRoot common.ps1)
|
|
$allPackageProperties = Get-AllPkgProperties $serviceDirectory
|
|
if ($allPackageProperties)
|
|
{
|
|
New-Item -ItemType Directory -Force -Path $outDirectory
|
|
foreach($pkg in $allPackageProperties)
|
|
{
|
|
if ($pkg.IsNewSdk)
|
|
{
|
|
Write-Host "Package Name: $($pkg.Name)"
|
|
Write-Host "Package Version: $($pkg.Version)"
|
|
Write-Host "Package SDK Type: $($pkg.SdkType)"
|
|
$outputPath = Join-Path -Path $outDirectory ($pkg.Name + ".json")
|
|
$outputObject = $pkg | ConvertTo-Json
|
|
Set-Content -Path $outputPath -Value $outputObject
|
|
}
|
|
}
|
|
|
|
Get-ChildItem -Path $outDirectory
|
|
}
|
|
else
|
|
{
|
|
Write-Error "Package properties are not available for service directory $($serviceDirectory)"
|
|
exit 1
|
|
}
|
|
|