So here’s a quick little blog about something i discovered in powershell while googling today.
Lots of vendors like to use version numbers including Major.Minor.Build.Revision.
An example of a vendor I was dealing with recently was Citrix themselves.
The problem is, in powershell, it’s not that easy to take a string (text) representative of these, split it up then label it yourself. you’re splitting, taking objects in an array, assigning them values… nasty.
Did you know .Net has a native ability to do this?
Now with system.version, it’s very easy to do comparisons! Just cast your string into a [system.version] as below:
After that, just compare the major, minor, build or revision at will!
Happy version comparing!