This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Ce script PowerShell analyse un lecteur donné et génère un fichier contenant la liste des fichiers et leurs hachages SHA256. | |
| .DESCRIPTION | |
| Ce script prend le nom d'un lecteur en tant qu'argument et parcourt tous les fichiers du lecteur, y compris les fichiers et dossiers cachés. Il calcule le hachage SHA256 de chaque fichier et enregistre les informations dans un fichier nommé "analyse_<DriveName>.list". | |
| .PARAMETER DriveName | |
| Le nom du lecteur à analyser. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-ChildItem -Path . -Recurse -File | ForEach-Object { | |
| $hash = Get-FileHash -Path $_.FullName -Algorithm SHA256 | |
| $_ | Select-Object -Property FullName, CreationTime, LastWriteTime, LastAccessTime, Length, @{Name="SHA256"; Expression={$hash.Hash}} | |
| } | |
| Get-ChildItem -Path . -Recurse -File | ForEach-Object { | |
| $hash = Get-FileHash -Path $_.FullName -Algorithm SHA256 | |
| $_ | Select-Object -Property *, @{Name="SHA256"; Expression={$hash.Hash}} | |
| } | Format-List > analyse.list |