@@ -73,9 +73,14 @@ $artifactFiles = @(
7373foreach ($artifact in $artifactFiles ) {
7474 $filePath = Join-Path $ReleasePath $artifact.file
7575 if (Test-Path $filePath ) {
76- $hash = (Get-FileHash - Path $filePath - Algorithm SHA256).Hash.ToLower()
77- $checksums [$artifact.key ] = $hash
78- Write-Host " Checksum $ ( $artifact.key ) : $hash "
76+ try {
77+ $hash = (Get-FileHash - Path $filePath - Algorithm SHA256).Hash.ToLower()
78+ $checksums [$artifact.key ] = $hash
79+ Write-Host " Checksum $ ( $artifact.key ) : $hash "
80+ } catch {
81+ Write-Error " Failed to compute checksum for ${filePath} : $_ "
82+ exit 1
83+ }
7984 } else {
8085 $missingArtifacts += $artifact.file
8186 }
@@ -126,6 +131,22 @@ foreach ($line in $extYaml -split "`n") {
126131}
127132if ($currentProvider ) { $providers += $currentProvider }
128133
134+ # Validate required fields were parsed
135+ $requiredFields = @ (' namespace' , ' displayName' , ' description' )
136+ foreach ($field in $requiredFields ) {
137+ if (-not $extMeta [$field ] -or $extMeta [$field ] -eq ' ' ) {
138+ Write-Error " Required field '$field ' missing or empty in extension.yaml"
139+ exit 1
140+ }
141+ }
142+
143+ Write-Host " Parsed extension metadata:"
144+ Write-Host " namespace: $ ( $extMeta.namespace ) "
145+ Write-Host " displayName: $ ( $extMeta.displayName ) "
146+ Write-Host " description: $ ( $extMeta.description ) "
147+ Write-Host " capabilities: $ ( $capabilities -join ' , ' ) "
148+ Write-Host " providers: $ ( $providers.Count ) "
149+
129150# Load template and replace placeholders
130151$template = Get-Content $TemplatePath - Raw
131152$replacements = @ {
@@ -217,7 +238,6 @@ Write-Host "Registry contents:"
217238Get-Content $registryFile
218239
219240# Upload to storage
220- $ErrorActionPreference = ' Continue'
221241azcopy copy $registryFile $RegistryBlobPath -- overwrite= true
222242if ($LASTEXITCODE -ne 0 ) {
223243 Write-Error " Failed to upload registry to $RegistryBlobPath (exit code $LASTEXITCODE )"
0 commit comments