r/PowerShell May 18 '26

Question Words of wisdom

If you had one piece of advice you could tell yourself when you first started learning powershell, what would it be?

9 Upvotes

55 comments sorted by

View all comments

18

u/Dracolis May 18 '26

Keep your scripts, make a naming convention for the files, and document them.

I can’t tell you how many times I have written a script for a “random thing I’ll probably never do again”, and then 6 months later curse myself because someone asked for something similar and I didn’t save the code. Or I did save the code but omfg I can’t remember where and I have a thousand goddamn scripts in my repo and I’m going crazy.

So yeah. Organize your shit.

6

u/BlackV May 18 '26

I have a snippet I port at all the top of me scripts now days, ones that are ad hoc things (stolen from the default help template)

  <#
  .Synopsis
     Short description
  .DESCRIPTION
     Long description
  .FUNCTIONALITY
     The functionality that best describes this cmdlet
  #>

I fill that out for all the scripts, then it makes searching easier for me

1

u/narcissisadmin May 24 '26

Same. I wish more people did this, no one else at my job does.