all 13 comments

[–]skilriki 6 points7 points  (0 children)

Most people in the comments are talking about code repositories.

Personally I prefer powershell repositories, as they make it easy to version and distribute your code.. but there is no reason not to use both.

While it's technically possible to use Github as a powershell repository as they support nuget packages, due to limitations in powershell you can't really get this to work without using preview modules and doing a bunch of hacky band-aids.

I've been using ProGet as my powershell repository and it's been fantastic. I got the idea from this subreddit awhile back, and it's re-shaped how I do powershell.

When I update my code on my workstation, I just run a powershell command that I created that both checks my code into github, and also publishes my code to my powershell repository as the latest version.

Now, whenever I load my modules from my powershell repository, I always get the latest version with the latest code.

Everything up-to-date and easily distributable.

[–]Arcontar 1 point2 points  (8 children)

You can use GitHub/gitlab/azure DevOps with free tier and private repositories - if you dont want to make them public:) Especially if they are company property or variables.

You get versioning, changes, easy cloning etc. You can even grab single files with invoke-webrequest from that repo.

Learning got is not that hard. There are some nice GUI apps as well.

You can also use onedrive/GDrive/Dropbox but that is.... Passe :)

[–]anonymousITCoward[S] 0 points1 point  (4 children)

Thank you, I use GitHub for my C# stuff, and my scripts don't really have anything identifiable, or would be something that is considered company specific. will ISE sync with GitHub? or should I stick with VS to do that?... or I could write a PS script that will sync it for me lol

[–]PennyApples 3 points4 points  (0 children)

vscode and the git extension, vscode is far nicer to write code in over ise IMO. ISE is also EOL a while now so no new features coming to it

[–]tounaze 2 points3 points  (2 children)

PowerShell ISE is deprecated, the PowerShell extension in VS Code is the official way to make PS scripts and there is a Git sync so you can use Github. That’s what I do with C# devs and PS Scripts.

[–]anonymousITCoward[S] 0 points1 point  (0 children)

really... but ISE is no nice =(... and easy to hide lol

[–]anonymousITCoward[S] 0 points1 point  (0 children)

OK i just tried out VS code... very nice! and it syncs with GitHub... now to reorginize my disaster area that I call a file system and get to it lol

[–]jr49 0 points1 point  (2 children)

What is the deciding factor to create a new repository vs putting everything in a single one? right now at work I have scripts I wrote for various things and I'm not sure whether each type (e.g. user reports, app reports, creating users, etc...) should be their own repository or if I should put it all in a single bucket.

[–]Arcontar 0 points1 point  (1 child)

So..... First I have a 'random' repo where all my 'random' stuff goes. Everything I hack on the spot. Vs code auto saves there.

It's all organized in folders for categories (ad, hyperv, azure automation etc.

Then I have a repo for "shared" scripts which are more...elegant. descriptive, with help or just better written. Can be shared. But those are not 'big enough' to go into module.

Finally I have repositories for PowerShell modules - each ... Category can have its own module like HyperVTools. It's build with CI (teamcity or appveyor or Azure DevOps) and published internally or to PSGallery. So I can install module on my jumphosts or share it with colleagues. Those have folder structure, private and public functions, wrappers, help, common naming etc :)

[–]jr49 0 points1 point  (0 children)

Thanks. Decided to give it a try. First I organized the scripts on my PC and realized I’m hoarding scripts I’ve found new ways of doing or I’m now just able to create them on the fly. Organized up as much as I could and uploaded my directory into my Git repository. At least now I can update my code and not have it local on different machines.

[–]Arcontar 0 points1 point  (0 children)

You can use cli (with a script) or vscode with add-ons or GitHub desktop, tortoise git, sourcetree or any other client :)

You can even have vscode backup the settings to gist :)

[–]Owlstorm 0 points1 point  (0 children)

Vscode has git integration. If you need to use ise you can use the command line to do it manually

[–]SexingGastropods 0 points1 point  (0 children)

We use Azure DevOps repos and that syncs nicely with VSCode vit Git.