azure-sdk-for-cpp/eng/common/scripts/Save-Package-Properties.ps1
Azure SDK Bot 5c55a82933
Sync eng/common directory with azure-sdk-tools for PR 1729 (#2473)
* Check for API review status only if release date is set in changelog

* Change property name to ReleaseStatus

Co-authored-by: Praveen Kuttappan <praveen.kuttappan@gmail.com>
2021-06-24 12:14:09 -07:00

44 lines
1.3 KiB
PowerShell

[CmdletBinding()]
Param (
[Parameter(Mandatory=$True)]
[string] $serviceDirectory,
[Parameter(Mandatory=$True)]
[string] $outDirectory
)
. (Join-Path $PSScriptRoot common.ps1)
$allPackageProperties = Get-AllPkgProperties $serviceDirectory
if ($allPackageProperties)
{
if (-not (Test-Path -Path $outDirectory))
{
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)"
Write-Host "Artifact Name: $($pkg.ArtifactName)"
Write-Host "Release date: $($pkg.ReleaseStatus)"
$configFilePrefix = $pkg.Name
if ($pkg.ArtifactName)
{
$configFilePrefix = $pkg.ArtifactName
}
$outputPath = Join-Path -Path $outDirectory "$configFilePrefix.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
}