简体   繁体   中英

Script Versioning

I am working on a very large script and I stumbled across one issue already, how can I version the scripts? (ex) superscript.ps1 is on version 2 but if a user is using version 1 of the script it will notify them during the initialization of the script.

basically I can't restrict where they are pulling it from, so I thought about keeping a "CurrentVersion" File on one of our servers and keep the version number in it but how could I get the running script to check that file and error out?

CurrentVersion.txt
superscript1, 2.0
superscript2, 2.5
script1, 10.2

I just can't find what would be a plausible way of actually implementing something like this, any help or pointing in the right direction would be appreciated.

Honestly I think the way to go here is to stop doing development in the central folder where the production version of your script lives.

Start using git, do development on local machines or dev boxes or something, in a new branch. Merge to master when you're done and either copy master to the central location or pull it from a centralized repo (GitHub, Bitbucket, GitLab).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM