[TOC]
The CSVERIFY module is designed to assist in ensuring the integrity of a codebase by generating and verifying a VERIFICATION.txt file.
New-VerificationFile
generates the verification file. recersivlly compiles a list of all files present. For each file, it computes the SHA256 hash and records the file, path, size and its hash in the verification file(VERIFICATION.txt).
#Default output .\tools\VERIFICATION.txt
cd /path/to/folder
New-VerificationFile
VERIFICATION.txt output example
Test-Verification
is used to verify the integrity of the codebase base it compares the SHA256
values from VERIFICATION.txt file and Returns file report
Verification output
๐ซ Clone the repository from GitHub git clone https://github.com/sgkens/csverify.git
๐ซ Open a PowerShell session and navigate to the cloned repository directory.
๐ซ Run the Module Import via the command below:
# Import the module
git clone https://github.com/sgkens/csverify.git
cd csverify
Import-Module -Name csverify
Get-Module -Name csverify
# Check imported Module Functions
Get-Module -Name csverify | Select-Object -expand ExportedFunctions
Get-Module -Name csverify | select-object version
Download the latest release from the Releases page.
# Install The Module from the PsGal
Install-Module -Name csverify -force
# Import Module into you powershell session
Import-Module -Name csverify
Note! You may need to
Set-ExecutionPolicy
toRemoteSigned
orUnrestricted
to install from the PSGallary.
# Install The Module from the PsGal
choco install davilion.csverify
# Import Module into you powershell session
Import-Module -Name csverify
How-to! Installing Chocolatey Package Repository How to Install ๐งทhttps://chocolatey.org/install
New-CheckSum generates and returns sha256 hash for each within the specified folder. New-Verification unitilizes New-Checksum
& Read-CheckSum
.
New-CheckSum -Path .\
Read-CheckSum reads the verification file and returns a PSCustomObject
array containg the file, path, size and hash.
Read-CheckSum -Path .\
New-VerificationFile generates the verification file. recersivlly compiles a list of all files present. For each file, it computes the SHA256 hash and records the file, path, size and its hash in the verification file(VERIFICATION.txt).
New-VerificationFile
Test-Verification is used to verify the integrity of the codebase base it compares the SHA256
values from VERIFICATION.txt file and Returns file report.
Test-Verification