Replies: 3 comments 15 replies
-
Hello @mooock and greetings from your neighbor (Skåne/Sweden)! ...it really was a real nightmare for me to get that GPO administration right (and still it contains bugs, see #346) and the reason is that I'm a dinosaur (both in age and experience) and this was my first try in PowerShell at all (coming from BAT/CMD/ST Basic/AHK/VB). The GPO Blacklist/Whitelist and the requirement to also fill in where you want to pull the list from came from me wanting to have more options to switch between sources without being forced to rewrite the GPO list if I changed back to GPO (pulling from URL both private and in my company at the moment) And yes, this journey has been that of a lot of different requests/ideas over time, so it lacks the grand thought/rules to bind everything together... ...but it just works (for the most)! 😁 But, you're more than welcome to join us and improve the code base! |
Beta Was this translation helpful? Give feedback.
-
A small step, learning by doing... 🤪
|
Beta Was this translation helpful? Give feedback.
-
I think I have found the logic for it now, implemented 8 easy ones:
|
Beta Was this translation helpful? Give feedback.
-
I was trying out a POC of using this app, and was aiming at using GPO to administrate. I do quite a bit of Powershell code daily and really had trouble finding out the connection between the functions. and design of all the possibilities. The function for including apps looked very complicatede and it must have been a nightmare to get right. i think a good approach instead would be to use Hash tables and switch statements to get rid of all those if/else
one other thing that would be great to improve is that each function are able to provide a output without references and dependencies to the main ps1. it was very hard to read out when you use script variables from one script and pass it to a function. If going for such approach i would think it was better to define all the global or script variables at the top of the main script, like the regpaths and static values that are reused.
for the include app function i recommend using PSOBJECT at output the same vaules no matter if it is a text file or GPO value. i really got confused why the function could not run by its own but found out half of the variables was set from the main script. the same goes for using return values. In powershell PSobject should provide the data another function uses, in your function i both outputs a object and return value.
the policy function would also benefit for using more of Bool statements instead of the change++ incremental for detecting changes between the uninstall reg and GPO value.
what i mean by confusing. is that i was sure the script didn't work as intented. but everything was up for me to not understand the logic behind using GPO. I think this complication comes from a lot of user request or features being build on top of a design that expanded over time..
for for me using GPO or setting the GPO override i really expected that it only used GPO settings. so it took me a while to understand i needed to write GPO inside the source list. also when adding apps to the whitelist it was really hard to understand why it didn't read this list. maybe the logging was a good idea to improve with more data.
as i could understand people has requested some sort of merge between GPO and config settings. this might overcomplicate things. its not clear what will oweride what, and what settings being used.
one last thing i recommend is that maybe simplify listpath param. so GPO is not needed if you already have set GPO override or start to add programs to the whitelist. if programs are added to the list it should be expected that the users is aiming at a GPO list
i did an approch for a change on the includeapp to get the same output as the list view. but didn't get the part to use a variable inside a foreach loop and also output objects. normally it is said if you use a string twice you should add it to a variable.
Beta Was this translation helpful? Give feedback.
All reactions