@@ -101,34 +101,36 @@ if ($allPackageProperties)
101
101
}
102
102
foreach ($pkg in $allPackageProperties )
103
103
{
104
- Write-Host " Package Name: $ ( $pkg.Name ) "
105
- Write-Host " Package Version: $ ( $pkg.Version ) "
106
- Write-Host " Package SDK Type: $ ( $pkg.SdkType ) "
107
- Write-Host " Artifact Name: $ ( $pkg.ArtifactName ) "
108
- Write-Host " Release date: $ ( $pkg.ReleaseStatus ) "
109
- $configFilePrefix = $pkg.Name
110
- if ($pkg.ArtifactName )
111
- {
112
- $configFilePrefix = $pkg.ArtifactName
104
+ if ($pkg.Name ) {
105
+ Write-Host " Package Name: $ ( $pkg.Name ) "
106
+ Write-Host " Package Version: $ ( $pkg.Version ) "
107
+ Write-Host " Package SDK Type: $ ( $pkg.SdkType ) "
108
+ Write-Host " Artifact Name: $ ( $pkg.ArtifactName ) "
109
+ Write-Host " Release date: $ ( $pkg.ReleaseStatus ) "
110
+ $configFilePrefix = $pkg.Name
111
+ if ($pkg.ArtifactName )
112
+ {
113
+ $configFilePrefix = $pkg.ArtifactName
114
+ }
115
+ $outputPath = Join-Path - Path $outDirectory " $configFilePrefix .json"
116
+ Write-Host " Output path of json file: $outputPath "
117
+ $outDir = Split-Path $outputPath - parent
118
+ if (-not (Test-Path - path $outDir ))
119
+ {
120
+ Write-Host " Creating directory $ ( $outDir ) for json property file"
121
+ New-Item - ItemType Directory - Path $outDir
122
+ }
123
+
124
+ # If package properties for a track 2 (IsNewSdk = true) package has
125
+ # already been written, skip writing to that same path.
126
+ if ($exportedPaths.ContainsKey ($outputPath ) -and $exportedPaths [$outputPath ].IsNewSdk -eq $true ) {
127
+ Write-Host " Track 2 package info with file name $ ( $outputPath ) already exported. Skipping export."
128
+ continue
129
+ }
130
+ $exportedPaths [$outputPath ] = $pkg
131
+
132
+ SetOutput $outputPath $pkg
113
133
}
114
- $outputPath = Join-Path - Path $outDirectory " $configFilePrefix .json"
115
- Write-Host " Output path of json file: $outputPath "
116
- $outDir = Split-Path $outputPath - parent
117
- if (-not (Test-Path - path $outDir ))
118
- {
119
- Write-Host " Creating directory $ ( $outDir ) for json property file"
120
- New-Item - ItemType Directory - Path $outDir
121
- }
122
-
123
- # If package properties for a track 2 (IsNewSdk = true) package has
124
- # already been written, skip writing to that same path.
125
- if ($exportedPaths.ContainsKey ($outputPath ) -and $exportedPaths [$outputPath ].IsNewSdk -eq $true ) {
126
- Write-Host " Track 2 package info with file name $ ( $outputPath ) already exported. Skipping export."
127
- continue
128
- }
129
- $exportedPaths [$outputPath ] = $pkg
130
-
131
- SetOutput $outputPath $pkg
132
134
}
133
135
134
136
Get-ChildItem - Path $outDirectory
0 commit comments