Reputation: 46496
As soon as you start using PowerShell, you are likely to start collecting small, useful scripts. Managing them well is tricky.
Upvotes: 8
Views: 2823
Reputation:
I keep my powershell profile & custom scripts in a mercurial repository. I frequently switch between my development machine at home and the development environment at work so using a distributed VCS really has its advantages: Each machine is self-contained (no need to access a source-control-server at work from home through a VPN that does not exist in my case).
I pull/push changes from the local repo on each machine to a "transfer" repo on USB stick and things still work out correctly.
Upvotes: 1
Reputation:
+1 for source control. Our project's powershell scripts usually wind up in one of:
For personal scripts, at the moment I use two approaches. First I create a ~\Bin, put that in the path and put my personal PowerShell scripts there. The second approach is that I use Live Mesh to sync a PowerShell folder between all my machines. It has scripts, presentations, etc in it.s I should probably create a Bin subdir in the mesh folder and put that bin dir in my path.
V2 introduces Module support, so any modules I create would go under ~\Documents\WindowsPowerShell\Modules.
Regarding the question about using scripts from others and versioning, read up on Modules and Module Manifests in V2. I think this new feature will help.
Upvotes: 1
Reputation: 754585
I put everything into source code control including my ever expanding powershell library. This the primary way I version and spread the scripts amongst machines.
Upvotes: 0
Reputation: 34543
We treat PowerShell scripts just like other code. They are stored in TFS just like everything else. This handles storage, backups, versioning, and merging. Our standard build & deployment process handles moving these scripts between servers.
Upvotes: 2