File Version Control

File Version Control can save multiple versions of a script. It creates minor and major versions, can compare versions and identify differences, and restore previous versions.

File Version Control is a simple yet effective way of source control. Unlike sophisticated source control systems, it is tailored to the needs of a “one-person-developer cycle” and does not require any additional software, databases, special folders, or alike. It just works.

Enabling File Version Control

Click the VersionControl addon button to display the version control.

Enable File Versioning

To use the tool, make sure your script is saved to file.

Creating New Version Snapshots

When you feel it is time to create a new version snapshot, click “Add New Version”, and choose “Add New Major Version” or “Add New Minor Version”.

Create new version snapshot

A new version snapshot is added to the list of snapshots.

Check “Auto Mode” if you want ISESteroids to create a new minor version each time the script file changes. Note that this will create a large number of snapshots but provides the most granular version control.

Classifying and Annotating Version Snapshots

To add information to your snapshot, click the appropriate link. To mark a snapshot as “stable” or “beta version”, for example, click on the link to the left of a snapshot. Once you select a classification, it will be displayed as new link text.

Likewise, when you click on “Notes”, you can add text notes. They will appear as tooltip when you hover over “Notes”.

Classify version snapshot

Consolidating Snapshots

To turn all minor versions to a new major version, click “Add New Version”, and then choose “Add New Major Version and Remove Minor Versions”. This will remove all minor versions and instead add a new major version.

Comparing Version Snapshots

To compare two snapshots and see the code differences, click on “Compare”. The snapshot you select will always be compared against your current version. Your current script needs to be saved if it is not up to date.

By default, the 3rd party tool “WinMerge” opens, and displays both scripts, highlighting¬†the differences. You can use any other File Comparison tool instead, if you like.

Below, we walk you through configuring VisualStudio as your default file comparison tool instead of WinMerge.

Hide If WinMerge will not run, this may be due to the location where you installed ISESteroids. WinMerge is a portable app and will not run when launched from inside a ProgramFiles folder.

You can however manually copy WinMerge to another location, and then use the strategy described below to change the path of WinMerge. ISESteroids will then call WinMerge in the location you specified.

If this won’t help, make sure you run WinMerge manually so you can find out what the cause of the problem is.

 

Compare Code Differences

To undo a change, click the “Copy Left” button. To move to the next change, use the other navigation buttons in WinMerge.

Once you close WinMerge, you will be prompted if you want to save your changes. If you do, ISESteroids detects the file change and offers to reload the changed script.

Using a Different File Compare Tool

WinMerge is just one way of comparing files. If you prefer a different comparison tool, or if WinMerge will not work for you, simply ask ISESteroids to use another tool: Click “Add New Version” to open the context menu, and choose “Configure File Comparison Tool”. This opens a dialog.

Add the path to the executable, and in the textbox below, add the arguments that your tool should receive.

The placeholders that you can use are listed in the dialog window.

Using Visual Studio as File Comparison Tool

Using the customization dialog, here is a quick walkthrough that lets you use VisualStudio as file comparison tool. This requires of course that you have installed VisualStudio on your machine.

  1. Open the “Configure File Comparison Tool” dialog as described above, and choose “Custom”.
  2. Click “Find”, and navigate to your VisualStudio installation folder. Find the executable “devenv.exe”, and select it (see screenshot below)
  3. In the “Arguments” field, enter:
/diff "{2}" "{3}" "{0}" "{1}"

Click “OK” to save the settings.

Configure File Comparison Tool

Now, when you click the “Compare” link in version snapshots, VisualStudio opens and displays the file differences.

Note: If VisualSudio was running already, the command adds a new child window to the running instance, showing the file differences. It opens a new instance of VisualStudio only if there was no running instance.

Visual Studio as File Comparison Tool

Examining Version Snapshots

All version snapshots are saved in a ZIP file with the name of your script. To examine the version archive, click “Add New Version”, then click “Open History Archive in Explorer”.

Keeping your snapshots in a ZIP file makes it easy to remove the ZIP file before handing over scripts to customers. You can keep your ZIP file in a save location and use it as documentation tool, and you can add the ZIP file again any time. Simply make sure the zip file is located in the script folder.

When you rename a script, it is your responsibility to also rename the ZIP file if you want to keep it attached to your script.

 

Facebooktwittergoogle_pluspinterestlinkedinFacebooktwittergoogle_pluspinterestlinkedin