Automation/Web Scraping stuff

Easy-Utilities

It's a GUI for automating common tasks written in PowerShell! This was a hobby project. I use PowerShell as a Sysadmin, but I have never made a GUI.

This script automates tasks fot anyone who is not comfortable working in CMD or Powershell with the click of a button. Most of the functions are related to getting info for network or system diagnostics, with a few extra utilities like the browser cache functions. If you'd like to look at the code without an explanation, you can find it here: Easy Utilities. If anyone is curious I'm going to talk about the process of making this thing, particularly the weird/surprisingly challenging parts

One of the things I wanted to do with this is pull a very condensed list from the normal output of the Get-ComputerInfo so that when it was called only the really common info is listed. I also wanted to pull the data from the web. The workaround I came up with is here sysparams. This script essentially pulls data from a list I'm hosting at https://raw.githubusercontent.com/Kylebrody/Powershell-automation/main/infofilter.txt. It runs a ForEach to split and trim so that they are individual strings without white space. It loops through those strings again to store the properties in an array if they contain a value. That array is used so that you end up with a much more condensed list than what the normal cmdlet would output. I'm mostly talking about this to blow off steam because it was surprisingly challenging (Powershell syntax is not always your friend). The reason I hosted the data and called it from an external ps1 file is due to performance. GUI powershell apps can be slow, and I didn't want all the extra bloat in the code.

A surprise about Chrome (and why Edge is better? :O)

Ok not really. But it is just Chromium that's covered in Microsoft. One of the gui buttons was meant to clear Chrome cache. Simple right? Well yeah, but I learned something both weird and kind of annoying about Chrome.

Here's my Chrome Cache function:

Here's my Edge Cache function:

As it turns out, Chrome stores cache in a lot of places. For each Chrome profile there is a seperate directory that have multiple directories for cache. That basically means that if you have 10 chrome files, you have 10 directories full of nested cache directories. In order to automate clearing all that, my script has to push the end users individual profile names into an array before looping through each one to delete it all. I thought this was interesting because it's strange AND stupid. In the future I plan on probably adding functions for cookies, history, maybe even things like setting the homepage and purging/modifying bookmarks. I also want to add additional browsers. It's a hobby project on github so expect those updates whenever I feel like it.