Skip to content

Instantly share code, notes, and snippets.

@davlgd
Last active August 26, 2017 13:05
Show Gist options
  • Save davlgd/d6a10e12257fffcc5d61c1ffe303ec27 to your computer and use it in GitHub Desktop.
Save davlgd/d6a10e12257fffcc5d61c1ffe303ec27 to your computer and use it in GitHub Desktop.
Powershell script to zip files from a Visual Studio build to
cd "$(TargetDir)"
powershell.exe -ExecutionPolicy Unrestricted -f "Zip Hash and Sign.ps1"
New-Item -ItemType Directory -Force -Path Final
$appPath = (get-item $pwd).parent.parent.FullName
$fileName = (Split-Path -Leaf -Path $appPath) + ".zip"
$fullName = $pwd.Path + "\Final\" + $fileName
Compress-Archive *.dll -Force $fullName
Compress-Archive *.exe -Update $fullName
Compress-Archive *.config -Update $fullName
(Get-FileHash $fullName -Algorithm SHA256).hash + " *" + $fileName > ($fullName + ".sha256")
(Get-FileHash $fullName -Algorithm SHA512).hash + " *" + $fileName > ($fullName + ".sha512")
gpg --yes --armor -b $fullName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment