#stupid setup script
29 messages · Page 1 of 1 (latest)
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.

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.
Just a general look I guess. How does the style look, any big issues, bit of just showing off what I've made lol
Issues for what? Maintainability? Performance? General personal taste?
What was your take on data driven functions.
anything really. This is really the first proper script I've written so I wanna get some feedback.
I require more context to understand the query
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.
Looked into Write-Progress, it doesn't seem to do quite the same thing? Also not sure I understand the point of Install-PSResource over Install-Module, if you could explain.
Explained in the comment. Spotify won't install if run with elevated permissions, creating a shortcut and running it through Explorer gets around that.
I like the pop-up box because it's cool :)
Files are meant to be brought in together in a folder. Then they can call each other as specified in the script.
why do you want to have text on the screen? don't you just want to know the progress of the script?
install-module presumably will be deprecated and it is slower than install-psresource
bah. pwsh write-progress is cooler!
yeah so what does that look like? you have another script to run them all?
but good stuff. i know you worked hard to get all that going.
Setup1.ps1 calls WinGet.ps1 directly and schedules the other two with the registry RunOnce key and Task Scheduler respectively
The text is cooler
Cause like you can follow along with what it's actually doing in real time yk
Instead of just an approximation of "how far"
Will look into this. Keep in mind though that Setup1.ps1 and WinGet.ps1 have to run in PowerShell 5.
it is supported there. microsoft.powershell.psresourceget
i see it all come together now. good stuff.
eh. agree to disagree. that is the beauty of dev though.