azure-sdk-for-cpp/eng/common/scripts/Save-Package-Properties.ps1
Azure SDK Bot 31fc4a5dee
Sync eng/common directory with azure-sdk-tools for PR 1345 (#1517)
* Enforce API approval status for GA and include SDK type in package properties

* Fix per review comment

* Fixes as per review comments to avoid changing constructor signature

* Fixes as per review comments to handle track 1 packages

* Fix yaml format error

Co-authored-by: praveenkuttappan <prmarott@microsoft.com>
2021-01-29 13:13:41 -08:00

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
}