#stupid setup script

29 messages · Page 1 of 1 (latest)

drowsy kraken
plucky meadow
#

Hi, I recently read the book Practical automation with PowerShell by Matthew Dowst which has a chapter on building data driven functions to configure a security basline, which looks similar to what you're doing. There are some scripts you can look at as examples but the book explains how it works in detail: https://github.com/mdowst/Practical-Automation-with-PowerShell/tree/main/Chapter06 - Making adaptable automations . But I think the idea is to use functions that can use externalized data to provide registry keys and values to your script. Not sure if that's useful to you or maybe overkill but just thought I'd mention it just in case.

GitHub

Practical Automation in PowerShell reveals how you can use PowerShell to build automation solutions for a huge number of common admin and DevOps tasks. It takes you beyond scripting basics and show...

drowsy kraken
upper spoke
#

What are you trying to gather from a review?

#

It is a generic ask. What are your overall goals and problems you are trying to solve.

drowsy kraken
#

Just a general look I guess. How does the style look, any big issues, bit of just showing off what I've made lol

upper spoke
#

Issues for what? Maintainability? Performance? General personal taste?

#

What was your take on data driven functions.

drowsy kraken
drowsy kraken
upper spoke
#

On the setup.ps1: I dislike write-host. if you want progress, use write-progress. I would also dump install-module and use install-psresource which may be by default.

#

For winget.ps1, why do you need to wrap spotify install in a link?!

#

and don't use popup box on setup2.ps1. Just write a formal success [pscustomobject]@{ key = 'value'} or write-progress.

#

Otherwise it all looks pretty good. you can shorten lines with splatting if necessary. Additionally, I don't see how you are putting all this together in one script.

drowsy kraken
drowsy kraken
drowsy kraken
drowsy kraken
upper spoke
upper spoke
upper spoke
upper spoke
#

but good stuff. i know you worked hard to get all that going.

drowsy kraken
drowsy kraken
drowsy kraken
upper spoke
upper spoke
upper spoke