I am working on a PowerShell script for work and I think I've gotten in over my head.
We have a utility written and maintained by a co-worker, but it's a compiled executable more than 400mb in size that has to be redistributed to hundreds/thousands of users each time it's updated, which is pretty frequently (multiple times a month). I suggested that we re-write it in PowerShell, and kind of took over from there.
The utility scans a computer and performs a bunch of tests to see if it is compliant. I started converting the tests the other guy has done into PowerShell and it was pretty easy going.
A new requirement is that the tests need to be stored in Excel, so that anyone can open a spreadsheet and see what is being tested. I kind of had to go back to the drawing board. Some of the tests look for registry keys and some look for existing files and some look for file versions so I had to make a column for each test type in the spreadsheet, import it, and then perform the specific test based on the type.
Another new requirement is that management would like the tool to run either on a local system or a remote system. This isn't insurmountable but it really changes everything. At least in PowerShell, reading a local registry and a remote registry is completely different.
I recently learned that some tests require two tests, and now I'm completely lost. For example, for a machine to be compliant with, oh, Microsoft Word, it would check to see if Word exists (test 1) and then what version it is (test 2). My whole structure is based on reading the spreadsheet and having each line be a single test, so I may have to start completely over. I was trying to code some sort of loop that would be triggered by two tests in a row with the same name or something, but didn't have any luck.
I have written lots and lots of PowerShell scripts, but most of them aren't more than a page or two in length. I may have bitten off more than I can chew on this one.
"Jack Flack always escapes." -Davey Osborne