r/PowerShell • • 20d ago

Script Sharing ADSearch - User/Computer comparison tool

This Active Directory toolkit offers user/computer OU comparisons using fuzzy Levenshtein matching to determine if the computer is in an OU that matches the user's OU. Designed for large enterprise IT audits/asset management of complex (2+ OU levels) AD environments

ADSearch/README.md at main · Contoso-Administrator/ADSearch

Edit: Made some edits based on everyone's kind words :)

0 Upvotes

21 comments sorted by

View all comments

12

u/JSChronicles 20d ago

Minus points for:

  • Single character variables
  • Using new-object instead of pscustomobject in one or two places.
  • Doing this crap "$sourceLength = $Source.Length", why would you make a variable when you already have the object with the property? Dumb
  • Write-Host and spacing and ASCII everywhere... God damn didn't know I was reading high school leet code.
  • Using return... You don't need returns

4

u/uptimefordays 20d ago

LLMs love `return` because every other language uses that to return a value while PowerShell doesn’t.

-9

u/SoyBoy_64 20d ago edited 20d ago

Thanks for the feedback! Still kinda new at powershell, so any tips help!

I admit the opening banner was solely done for my amusement lol

Edit: these downvotes are getting comical 😂