Questions tagged [get-filehash]

15 questions
4
votes
0 answers

Get hash of object in Minio

Is there a method to get a hash (md5, sha, etc.) of an object directly of Minio using the python SDK? Is it possible to get the hash without requesting the file?
Lithilion
  • 1,097
  • 2
  • 11
  • 26
3
votes
1 answer

How to exclude files and folders from Get-ChildItem in PowerShell?

I've made a PowerShell script that runs robocopy with md5 checks. It works fine, but if I try to exclude some dirs or files, robocopy handles the exclusion, whereas MD5 part of script that compares the hash, doesn't work, returns some errors because…
ilRobby
  • 69
  • 2
  • 10
3
votes
1 answer

PS SHA512 hash of file, output as base 64 encoded string

I need to take the SHA512 of a file , convert to base 64 encoded string, and output to file. PS > Get-FileHash -Algorithm SHA512 I know this function is available [System.Convert]::ToBase64String
BaltoStar
  • 8,165
  • 17
  • 59
  • 91
2
votes
1 answer

Is there a way to include filepaths with diacritics in a robocopy script?

I have a script that extracts metadata from each file in a directory. When the filepath is free of diacritics, the script produces a csv file that looks like this: When the filepath includes a diacritic (ie. "TéstMé.txt"), the csv file has blanks…
oymonk
  • 427
  • 9
  • 27
1
vote
1 answer

How to extract raw Hash from String?

I'm trying to create a text file with file names and their MD5 hash next to them. Doesn't really make sense, but it's for learning purposes. This is how I calculate the hash: $hash = Get-FileHash -Algorithm MD5 -Path $file | Select-Object Hash Then…
user16967506
1
vote
1 answer

PowerShell Get-FileHash get rid of empty lines

I have foreach loop that go through file, get path and replace it in the command for getting hashes: $hash = @{} ... defining variables here ... foreach($line in $lines) { Get-FileHash $line -Algorithm md5 | format-list | Where { $_ } | …
Nemanja
  • 45
  • 3
1
vote
1 answer

Get-FileHash in the entire C: drive

I'm writing a script to collect all file hashes in the C: drive but doesn't grab everything. Anyone have any ideas? I tried a mix of things. gci -Path C:\ -Recurse | Get-FileHash -Algorithm MD5 | Out-File C:\test.txt
Hakdicap
  • 45
  • 4
1
vote
1 answer

Compare File Hash in PowerShell

I'm very new to Powershell, but am attempting to write a simple function to compare two files using their hashes. I'm getting some unexpected results using the following : $hash1 = Get-FileHash $source | Select-Object Hash Write-Host(" hash1 : "…
Phil S
  • 123
  • 8
1
vote
1 answer

"$xyz" and "Write-Host "$xyz"" giving different output

I am hashing all the files in one location, an origin folder, and writing the hashes to a variable and then doing the same to all the files in another location, a destination folder: $origin = Get-ChildItem .\Test1 | Get-FileHash | Format-Table…
Ken
  • 125
  • 1
  • 12
1
vote
1 answer

How can I simply check whether two Excel files are the same, or not

I don't want to know WHAT are the differences, I just want to know "Y/N Are these sheets identical?" Unfortunately, superficially Hashing the file doesn't answer that :( Specifically ... I took an .XLSX file, and file-copied it. Compared hashes ...…
Brondahl
  • 7,402
  • 5
  • 45
  • 74
0
votes
1 answer

Same file, different hashes with PowerShell Get-FileHash command

I'm trying to write a PowerShell script that will copy image files from one folder to another, but only if the files don't already exist in the destination folder. The files are randomly named. The issue is that Get-FileHash keeps returning…
Alon_EH
  • 11
  • 2
0
votes
2 answers

Recreating a linux md5 checksum on Windows

I'm performing some pretty straightforward checksums on our linux boxes, but I now need to recreate something similar for our windows users. To give me a single checksum, I just run: md5sum *.txt | awk '{ print $1 }' | md5sum I'm struggling to…
16shells
  • 106
  • 2
  • 13
0
votes
1 answer

Powershell Script to compare File-Hash from a Stream and published

Good morning guys, I'm new to powershell scripting. And i can't figure out what I'm doing wrong. I tried to write a .ps1 script to compare the hash value of a stream. I used the microsoft documentation for help and modify it to a runable script so i…
blQSheep
  • 87
  • 1
  • 6
0
votes
2 answers

how to combine Get-ChildItem and Get-FileHash output? powershell

I want to get table like name-algorithm-hash for files, ended by .gz in folder a filtration work well: powershell -command " Get-ChildItem -Filter 'L04\*.gz' | Select Name" give a table: Name v300040828_run20_L04_62_1.fq.gz…
breezin
  • 15
  • 4
0
votes
1 answer

Nagios plugin to check md5 directory sum in Windows powershell

Hi im trying to make my own plugin to check md5 sum inside directory and compare it with old one. I wrote a script below $Patch1= "C:\Users\User\Downloads\" $Patch2= "D:\sqls\" # Check both hashes are the same Function Get-DirHash($Path1) { gci…