im still without a good way to 1. get the MAC address 2. fail if the platform isn't windows 3. redirect the output to $PSScriptRoot\winlic\txtfile.txt 4. have the linter stop yelling at me (PSScriptAnalyzer)
@tost aaa i discovered the error of my ways: variables in powershell are properly local to each function so the uuid function needs to be declared under main()
@tost so i resorted to powershell because i was unable to store the output of a command inside a variable (i was trying to get wmic csproduct get UUID originally)
but powershell scripts aren't executed on double-click by default + u need to configure the exec policy therefore batch that invokes the ps1:
there's some code there for future expansion of other things: tsince i have arrays in a language (for once, internal POSIX sh pseudoarrays cries of angst) i tried to both create all dirs for future functions and the exec functions inside arrays/loops, instead of duplicating each path check code everytime
my idea is to get licenses output by double clicking and have a name like <UUID>-lic.txt so no files are overwritten when i move it around several computers and each file identifies each computer
i tried with MAC addresses but i didn't find a powershell equivalent command (wmic is so handy but it's going deprecated)
even after replacing ! with -Not it's still not working so im sad
@tost it's my first day ever with powershell im trying to automate something so i can just plug USB in, doubleclick, move to another computer with USB and gather some info instead of manually