Skip to content

Instantly share code, notes, and snippets.

@mbcolbert
mbcolbert / CheckJarIntegrity.ps1
Created October 8, 2024 12:45
Find corrupt jar files in a maven repo (powershell)
Add-Type -AssemblyName System.IO.Compression.FileSystem
# Initialize a counter for processed files
$processedCount = 0
Get-ChildItem -Path "C:\Users\<USERNAME>\.m2\repository" -Recurse -Filter "*.jar" |
ForEach-Object {
Write-Host "Checking file: $($_.FullName)" -ForegroundColor Green
try {
# Increment the counter for each file processed