r/PowerShell • u/LucaNegriAnalyst • 21d ago
Script Sharing I have a PhD-level background in static analysis, but I spent my week fighting PowerShell Runspaces just to delete duplicate memes.
As someone who usually deals with static analysis and abstract interpretation, I should know better. I should know that PowerShell is a single-threaded environment. I should know that building GUIs in PowerShell is an "obtuse mess".
But I also have 200GB of duplicate photos and videos, and I refuse to use a CLI for that.
So I present to you: **Duplicate Finder PRO**. A full WinForms GUI built entirely in PowerShell. Yes, I know. I hate myself too.
Here is a breakdown of my descent into madness:
* **The "Single-Thread" Trauma:** The first version froze every time I clicked a button. I had to learn the dark arts of `[runspacefactory]::CreateRunspace()` and `[System.Collections.Concurrent.ConcurrentQueue]` to stop the UI from hanging. If you've ever seen your PowerShell GUI go "Not Responding", you know my pain.
* **The PS2EXE Struggle:** I wanted a single portable EXE. I spent hours fighting with `$PSScriptRoot` returning empty strings inside the compiled EXE. I think I cried a little.
* **The Cache:** It uses a two-step detection (File Size + SHA-256) and saves a CSV cache. The second time you scan, it skips the hashing entirely. Because if I'm going to sin against god by making a PowerShell GUI, I might as well make it fast.
It works. It has a progress bar and a preview window where you can double-click to compare files side-by-side.
I'm sharing it here because I need validation, but also because I want to know: **What is the biggest cardinal sin you've ever committed in PowerShell just to avoid using the terminal?**
You can download the portable EXE and roast my UI here:
š https://github.com/lucanegrianalyst/duplicate-finder-pro/releases/latest
Please be gentle. I'm just an analyst trying to find my duplicates.
***AI Disclosure:** I used an AI to help me structure this post and fix my English, but the PowerShell code, the Runspaces, and the tears are 100% mine.*