Skip to content

Instantly share code, notes, and snippets.

@itsho
Created March 4, 2020 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsho/5d6ee41f1c3b6283b464f9d5af0a8150 to your computer and use it in GitHub Desktop.
Save itsho/5d6ee41f1c3b6283b464f9d5af0a8150 to your computer and use it in GitHub Desktop.
Create missing SHA256-hash-file for NuGet
#requires -version 4.0
[cmdletbinding()]
Param([Parameter(Position=0,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[string]$Path )
Process {
Write-verbose "Creating hash for input file..."
$hash = (Get-FileHash -Path $Path -Algorithm "SHA256").Hash
#write hash to file
$hash > "$Path.sha256"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment