I've found a bug with a software version checking script I created, and I've narrowed it down to PowerShell's version comparison behaviour illustrated below.
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.19041.2673
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.2673
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
>([version]113.0.0 -ge [version]114.0.0)
True
> ([version]113.0.0 -gt [version]114.0.0)
False
> (113 -ge 114)
False
> (113 -gt 114)
False
Surely the result of the first comparison:
>([version]113.0.0 -ge [version]114.0.0)
True
…should be False
, the same as when using the -gt
operator? What am I missing?