Author Posts

April 9, 2015 at 10:22 am

Hey folks,

I'm exceedingly interested to hear how any GitHub users are choosing their project/repository structure for their PowerShell files. I'm already using Git, but not certain if I'm using it as well as i could.

As a background, I've a collection of several hundred scripts I've written, almost all of them containing one cmdlet per file. Some of these files fit nicely into an application category (i.e. SCCM), and others either come under a general category (e.g. a cmdlet that copies/removes items to/from the clipboard ). At the moment, I have a single repository called Work, mapped to a folder Work. Under this folder are folders for each application category (and a general one), with the scripts stored in the relevant folder.

Whilst I reckon the most important thing at the moment is that all my scripts are now version controlled, I'm pretty certain just using the one large repository for everything isn't a good structure to do, but I'm also not certain if creating a repo per application is a good methodology either. It's confusing me no end.

Any tips?

April 9, 2015 at 10:46 am

I've used both approaches, but these days, I tend to put each module into its own repository. I do still have a private hodgepodge repo for various sample scripts / etc which aren't part of a module, mainly to keep things that I've shared via blog posts or the TechNet Gallery, but I haven't added anything new to that in several months.

April 9, 2015 at 12:10 pm

I have one lage repo that is categorized by subject (AD/Blog/DNS/Files/SystemCenter and so on) that mostly contains control scripts, small scripts, notes, demos and so on. This is my private mess 🙂

For modules and larger projects, basically anything where someone else might want to contribute, I prefer one repository per project. For private repositories with few contributors I use git with Visual Studio Online which is free for up to five users.

April 9, 2015 at 12:47 pm

Thanks chaps,it's good to know I'm not alone with this one. I like your approaches of the repository per module with the separate everything-else one. Got some tidying up to do at the weekend and hopefully see if I can retain some of the history for files I move to a new repo.

May 15, 2015 at 5:00 pm

Assuming everything was already in GIT, these two articles might be helpful :

Moving Files from one Git Repository to Another, Preserving History

http://tomrobertshaw.net/2013/09/migrate-file-to-a-new-git-repository-while-preserving-version-history/

I'm in the same boat kind of, I setup a local GitLab server at work, thinking of moving it to GoGs, but I also use a secondary private repo for a backup, which will make this clean up process doubly as messy.