powershell - How can I generate the same checksum as artifactory? -
as art.exe
(the artifactory cli interface) hangs whenever call build script, rewriting bash script page on topic in powershell 2.0. i'm using code generate checksum:
$sha1 = new-object system.security.cryptography.sha1cryptoserviceprovider $path = resolve-path "catvideos.zip" $bytes = [system.io.file]::readallbytes($path.path) $sha1.computehash($bytes) | foreach { $hash = $hash + $_.tostring("x2") } $wc=new-object system.net.webclient $wc.credentials= new-object system.net.networkcredential("svnintegration","orange#5") $wc.headers.add("x-checksum-deploy", "true") $wc.headers.add("x-checksum-sha1", $hash)
the problem consistently produces different checksum on local artifactory generates. it's not 'corruption during transmission' error because i'm generating checksum on local , i've manually deployed several times.
how can generate checksum in same manner artifactory (2.6.5) our checksums match when send mine , deploy won't fail? doing wrong when generating checksum?
thanks!
you have use
$wc.headers.add("x-checksum-sha1", $hash.tolower())
Comments
Post a Comment