How do you manage your powershell script library?

Tagged: 

This topic contains 4 replies, has 5 voices, and was last updated by Profile photo of Dan Potter Dan Potter 11 months ago.

  • Author
    Posts
  • #33570
    Profile photo of Wei-Yen Tan
    Wei-Yen Tan
    Participant

    I am just starting to build a whole lot of scripts but I don't think I am organising them properly/efficiently.

    I was just wondering how you guys organise your scripts (folder structure wise) before you put them into modules for final use so I can pick up some ideas.

    Thank you in advance.

  • #33571
    Profile photo of Wilfredo Perez
    Wilfredo Perez
    Participant

    I have a folder called scripting. Under that folder I have two other folders called vbscript and one the PowerShell. In the PowerShell folder, I create subfolder and the folder name depends on what I am working with. Ex. AD,Sccm,Gpo

  • #33578
    Profile photo of Deadly-Bagel
    Deadly-Bagel
    Participant

    Efficient methods really depend on the person and environment. Personally most of my scripts are pretty short so I have "Testing" and "Archive" folders for WIPs and finished scripts respectively, and I just give them descriptive names.

    Currently I can find everything I'm looking for easily but when the library expands to the point this is less easy I can use Get-ChildItem | Where Name -like "*keyword*" – To go a step further I use Get-Content and search the scripts themselves. Could even add these to a module so you only need to type Get-Script "*keyword*" or something and have a switch to open results in the ISE.

    If you have several categories you may wish to split them into subfolders but for me this would only confuse things as my categories would need to be so specific I'd find scripts applying to more than one, so again it depends on what you're doing and how you like working.

  • #33584
    Profile photo of Mark Hammonds
    Mark Hammonds
    Participant

    yup I just dump them into one big folder called scripts. then get-child-item bla bla -recurse | ?{$_ -like "kittens with bow ties"}

  • #33586
    Profile photo of Dan Potter
    Dan Potter
    Participant

    folders for each company I work for. Under that folders by project, folder for oneoff scripts I've written for other people, folder for reports.

    for gui's I write, I use sapien which organizes them into projects and files. It also has a start tab that lists all the recent scripts.

You must be logged in to reply to this topic.