check artifact size after download and extraction (#162407)

* just log it for now

* add size check
This commit is contained in:
Tyler James Leonhardt 2022-09-30 00:31:29 -07:00 committed by GitHub
parent bcb6c9b7e0
commit 9cad027389
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,6 +76,13 @@ do {
$null,$product,$os,$arch,$type = $artifactName -split '_'
$asset = Get-ChildItem -rec "$env:AGENT_TEMPDIRECTORY/$artifactName"
if ($asset.Size -ne $_.resource.properties.artifactsize) {
Write-Warning "Artifact size mismatch for '$artifactName'. Expected: $($_.resource.properties.artifactsize). Actual: $($asset.Size)"
$set.Remove($artifactName) | Out-Null
continue
}
Write-Host "Processing artifact with the following values:"
# turning in into an object just to log nicely
@{