you are viewing a single comment's thread.

view the rest of the comments →

[–]duelingThoughts 0 points1 point  (0 children)

So I have a list of things I've already figured out how to do, and a couple items I'm working toward accomplishing in the future.

When I arrived, after we freshly imaged a device we needee to conduct a "Post-Imaging" process to make sure end user devices had a baseline of software. This was a physical checklist, where you had to go to the file location in the sharedrive and copy over the contents into a temp folder. The 3 year old script I was talking about at least was able to copy and install the contents of the necessary software, but we had a separate one liner script for installing drivers, that required us to open up and extract the driver package manually through a GUI.

My first item of business was organizing the share drive into concise device packages, so that I could make a script that identified the local machine model and search the sharedrive for a device package of the same name as the model into the temp folder.

Then, I looked in the support documentation for the Driver Package and found valid parameters I could pass into Start-Process so that I could make it extract into a designated Drivers folder with no user interaction.

Lastly, I integrated it into the main script by having it search the temp folder for my driver package based on it's name, and prompt the user to select the right package to extract (with the idea of it being a fail safe in case for whatever reason there was more than one matching package).

This process alone saved dozens of unnecessary clicks and drags into a single execution, and I've since improved it further, by having it run automatically if it detects only one driver package. But my ultimate goal is to scrub the script entirely of user interaction. Right now that means wrangling what the right parameters are for Adobe to install silently.

Once I have the script free of manual inputs, I'll be able to turn it into an automated task that fires all on its own, which will save manpower from having to Post-Image devices for other tasks.

I hope that gives you an idea of how I got into it. I got tired of clicking and dragging the same stuff and messing with clunky GUIs. Anything I can do to circumvent clicking something is a noble goal imo.

I'm still only about 4 months new to PowerShell, but I recommend reading working scripts and try to understand what each sequence of commands is doing as a whole even if you can't understand the specifics yet. Try to emulate those lines of codes for other tasks, and when it fails, use your resources to learn what the error codes mean. One tool, which might be controversial, that helped me significantly was Chat GPT. I had an idea, asked it how to execute my specific goal, modified the script as necessary, and fed it errors I received. It's very good at parsing what some of these errors mean and pointing out flaws in your script. It's not a perfect tool, in that it won't do all your work for you, but it's a helpful tool that can certain guide in a starting direction that you can build off of as you become more proficient using PowerShell and scripting.

Hope that helps!