Tuesday, 13 May 2014

Ghetto Powershell fix: redux

Previously on ducksledge: We are forced to use a government-built program, and it's auto-update process regularly downloads broken builds. This makes using it a bit tricky.

We still have to use the software, it's now installed on every computer in the company, and it's still intermittently failing for weeks at a time. the script has changed a bit, so it's time for a repost.


And here's what it looks like:


Main Changes
  • Because the install base is bigger, it's easier to run it over the whole affected IP range than to work from a computer list. This also prevents the occasional hiccup where a computer got missed because the DNS cache was out of date.
  • It's a lot more verbose. It's now quick to tell at a glance where the script is up to, which is handy on the odd occasion it gets stuck.
  • After each loop it gives you some pretty yet fairly useless stats, because I like pretty things.

What would be required to make this a real fix:
  • Get rid of the main loop, and get it to run once through only. Trigger that ever 10 minutes or so from Task Manager. 
  • Set it to watch the affected program directory for new folders. If a new folder gets pulled down, it'll assume it's a fixed one.
  • Have it identify the directory it's copying dynamically, so there's now zero reason to actually edit the script. Just copy the working files to the right place, wait ten minutes, and it'll start rolling out.


1 comment: