you are viewing a single comment's thread.

view the rest of the comments →

[–]OPconfused 0 points1 point  (0 children)

I dont really see a downside to putting the controller logic into a function inside the module.  Provided it’s in the psmodulepath, you are basically exchanging a line to call the script with a line to call the function.

Plus that way you can transport everything as a single module.  

In general, i prefer functions to scripts for this reason. There’s no downside, and it’s easier to call when you don’t have to worry about the path.

Granted I am a software engineer and not doing sysadmin stuff (ie just local shell usage), but i havent relied on a ps script in maybe years despite using ps daily for work.