PowerShell and GitHub

This topic contains 4 replies, has 4 voices, and was last updated by Profile photo of Raymond Slieff Raymond Slieff 1 year, 6 months ago.

  • Author
  • #24109
    Profile photo of Tim Pringle
    Tim Pringle

    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?

  • #24110
    Profile photo of Dave Wyatt
    Dave Wyatt

    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.

  • #24111
    Profile photo of Simon Wåhlin
    Simon Wåhlin

    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.

  • #24112
    Profile photo of Tim Pringle
    Tim Pringle

    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.

  • #25295
    Profile photo of Raymond Slieff
    Raymond Slieff

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



    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.

You must be logged in to reply to this topic.