Very good point. Luckily what I am dealing with here should all start as 8.4 and have xxx.x as the last numbers, but I will pay a lot of attention to that in future, cheers!
On 3 April 2014 21:16, Ben Scott <[email protected]> wrote: > On Thu, Apr 3, 2014 at 2:59 PM, James Rankin <[email protected]> > wrote: > > I did this quick bit of PS to check a file version number and then > launch a > > patching process if it isn't at a certain level. It works OK but I am > sure > > there is a much cleaner and more elegant way to do this. Any pointers? > > More of an observation than a suggestion: > > Testing version numbers is one of those things that you'd think > would be easy but ends up being ridiculously complicated. Removing > separators and just treating it as one big number seems like a good > idea unless you want to compare version 11.2 with version 1.13. Plus > some people throw in letters. Testing release dates might seem like a > good alternative, but if the publisher is maintaining multiple release > branches, patch release 1.1.42 might be released after major release > 2.0.0. Blech. > > If the possible version numbers are more controlled, your method is > usually fine. > > -- Ben > > > -- *James Rankin* --------------------- RCL - Senior Technical Consultant (ACA, CCA, MCTS) | The Virtualization Practice Analyst - Desktop Virtualization http://appsensebigot.blogspot.co.uk

