With time, the number of PowerShell scripts I write keeps growing and growing, and I feel it is getting more and more difficult to find what I have done in the past. I won't say that all my scripts are great! Especially when I look at the scripts I wrote back in 2010/2011 or even 2012. I'm really happy to see the evolution as I keep learning about PowerShell. And honestly ... I think it is really fun to update old scripts, and it is always a good topic for a new blog post.
Today I will talk about my scripts directory, how I maintain it, which naming convention I use, what are my bottlenecks, my preferences ...
Naming ConventionPersonally I organize my directories this way:
For example, you would get those kind of folders for my scripts:
For my functions I have different standard, I had the prefix FUNCT, so those can be reused in other scripts (Dot Sourcing, mostly).
- Keep the script in one place! That's why I use SkyDrive (see below), easier to maintain when you access your scripts from different devices/locations.
- I don't like space, I never use space in the name of a folder or a script, always use the underscore "_" or a dash "-" characters.
- Instead of using files, I prefer to use folders for each script or function, especially if I want to keep track of different versions. Also Some scripts might need some XML config file, CSV file input etc... or just because your script is a project of multiple PowerShell script/functions files.
- Versioning/Version Control
- I did not play with any solution yet, it would be great to have tool that can do the tracking job for me
- Collaboration Tool
- I would like something like Google Docs where you see what each people are doing/typing, and obviously a solution that would support PowerShell files...
Note: I would be interested to hear how you guys get your scripts organized, I'm always looking for ways to improve my folders names and structures. Also I did not look into version control solutions yet, if you have tried any let me know.
SkyDriveI store all my scripts on Skydrive, Windows 8.1 comes with it !
Plus, Skydrive allows you to edit your file online! Pure Awesomeness! :-)
The only things missing are: We can't embed the files to another website, No version control unless you use the Pro version, No live collaboration tool.
|YES! you can edit your script right into the browser! :-)|
Thanks for Reading! If you have any questions, leave a comment or send me an email at email@example.com. I invite you to follow me on Twitter @lazywinadm / Google+ / LinkedIn You can also follow the LazyWinAdmin Blog on Facebook Page and Google+ Page