r/shittyprogramming • u/Aggravating_Judge_31 • Sep 26 '23
Discovered this brilliantly written Powershell script at my last job
79
Upvotes
r/shittyprogramming • u/Aggravating_Judge_31 • Sep 26 '23
18
u/[deleted] Sep 26 '23
Does it work?
18
u/Hatefiend Sep 27 '23
Nobody is gonna mention how instead of just re-assigning
Iphe just keeps making new one-time variables? lol8
u/Invidia1999 Sep 27 '23
I think the var names going from capitalized case to lower case as the number increases, is the icing on the cake for me. It really shows even the guy who made this got tired of it midway through.
6
u/ebbarosa Sep 27 '23
You never know when $ip3 comes in handy, better keep it in memory.
2
u/PopularDemand213 Sep 27 '23 edited Sep 27 '23
Couldn't understand why the split on " " and then [5]...
Then I went to the site and looked at the source code
🤣🤣🤣
Amazing ingenuity! A+
1
u/Zachisawinner Sep 28 '23
Oh Dyndns… quaint.
1
u/digitalghost0011 Sep 28 '23
I actually don’t think it is possible to write nice PowerShell though. I had to use it for an internship and it was torture. Unix’s “everything is text” model is so much better and PowerShell has shit syntax in any case.
1
u/HandjobOfVecna Sep 27 '23
I would be happy to see code like this in production! I can see that whoever wrote this:
I work with developers daily who cannot figure out things like: downloading a file from the browser app.
-3
u/Friznation69 Sep 26 '23
Lol, does a simple "curl ip.me" not work?