Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ steps:
- pwsh: |
$Path = "$(System.ArtifactsDirectory)"
$OutputPath = Join-Path $Path ‘hashes.sha256’
$null = New-Item $OutputPath -ItemType File -Force
foreach ($file in Get-ChildItem -Path $Path -File ){
Get-FileHash -Algorithm SHA256 -Path $file |
ForEach-Object { "$($_.Hash) *$($file.Name)" } |
Out-File -Path $OutputPath -Append
}
$srcPaths = @($Path)
$packages = Get-ChildItem -Path $srcPaths -Include * -Recurse

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include * is not required.

$checksums = $packages |
ForEach-Object {
Write-Verbose -Verbose "Generating checksum file for $($_.FullName)"
$packageName = $_.Name
$hash = (Get-FileHash -Path $_.FullName -Algorithm SHA256).Hash.ToLower()
# the '*' before the packagename signifies it is a binary
"$hash *$packageName"
}
$checksums | Out-File -FilePath $OutputPath -Force
$fileContent = Get-Content -Path $OutputPath -Raw | Out-String
Write-Verbose -Verbose -Message $fileContent
displayName: Add sha256 hashes

- pwsh: |
Expand Down