Reputation: 71
I need to compare 2 version numbers.
$version = '1.9.0'
$shareversion = Get-Content -Path \\Network-Share\some_file.txt
some_file.txt file has only the value 1.1.0
[Version]$version -lt [Version]$shareversion
Output is True
Upvotes: 1
Views: 93
Reputation: 58931
Did you checked the value of $shareversion
? Must be something wrong with your file or path because when you hardcode the $shareversion
the output is False
- as expected:
$version = '1.9.0'
$shareversion = '1.1.0'
[Version]$version -lt [Version]$shareversion
Output:
False
Upvotes: 2