DJKarismatiK Posted October 27, 2021 Report Share Posted October 27, 2021 Salut a tous, Je ne sais pas si ça existe déjà, mais suite a l’article de Kevin ENGEL hier : https://www.tech2tech.fr/comment-verifier-lintegrite-dun-fichier/ J'ai trouvé sympa de faire un petit script rapide pour exploiter cette fonction de powershell rapidement sans installer un programme: http://steveinfoservices.free.fr/robot.html http://steveinfoservices.free.fr/robot/GetHashMD5.zip #GetHash #Steveinfoservices.free.fr #V1.0 # Function Get-FileName($initialDirectory) { [System.Reflection.Assembly]::LoadWithPartialName(“System.windows.forms”) | Out-Null $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog $OpenFileDialog.initialDirectory = $initialDirectory $OpenFileDialog.filter = “All files (*.*)| *.*” $OpenFileDialog.ShowDialog() | Out-Null $OpenFileDialog.filename } #end function Get-FileName # *** Entry Point to Script *** $choice1= Get-FileName -initialDirectory “c:fso” Get-Filehash $choice1 -Algorithm MD5 | Format-list $verif = read-host " Coller la somme MD5 " $choice1 -eq $verif Read-Host -Prompt "Appuyer sur entree pour sortir" $choice1 -eq $verif Link to comment Share on other sites More sharing options...
Schwarzer Posted October 30, 2021 Report Share Posted October 30, 2021 Salut, Merci de cette contribution. N'hésite pas à mettre le code du script directement dans ton post. DJKarismatiK 1 Link to comment Share on other sites More sharing options...
DJKarismatiK Posted November 16, 2021 Author Report Share Posted November 16, 2021 Merci , Mais après des tests plus approfondi, je me suis aperçu que cela ne fonctionnait pas ....-_-... Après avoir tout corrigé, j'ai mis a jour le zip. C'est OK Nouveau code #GetHash #Steveinfoservices.free.fr #V1.0 # Function Get-FileName($initialDirectory) { [System.Reflection.Assembly]::LoadWithPartialName(“System.windows.forms”) | Out-Null $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog $OpenFileDialog.initialDirectory = $initialDirectory $OpenFileDialog.filter = “All files (*.*)| *.*” $OpenFileDialog.ShowDialog() | Out-Null $OpenFileDialog.filename } #end function Get-FileName # *** Entry Point to Script *** $choice1= Get-FileName -initialDirectory “c:fso” $choice2= Get-Filehash $choice1 -Algorithm MD5 | Select-Object -ExpandProperty Hash write-host $choice2 $verif = read-host " Coller la somme MD5 " $choice2 -eq $verif Read-Host -Prompt "Appuyer sur entree pour sortir" Schwarzer 1 Link to comment Share on other sites More sharing options...
Recommended Posts