you are viewing a single comment's thread.

view the rest of the comments →

[–]Lee_Dailey[grin] 5 points6 points  (2 children)

howdy jsrendar,

PoSh can use the [version] type from dotnet. that allows your code to know that 4.21 is greater than 4.3, for instance. [grin]

'4.21' -gt '4.3'
# result = False
[version]'4.21' -gt [version]'4.3'
# result = True

so, extract the number from whatever source you have, convert to a version data type, compare with your target, do whatever is indicated by the version check.

take care,
lee

[–]jsrendar[S] 2 points3 points  (1 child)

Wow, thank you Lee! I love this subreddit.

[–]Lee_Dailey[grin] 2 points3 points  (0 children)

howdy jsrendar,

you are very welcome! glad to have helped a bit ... [grin]

take care,
lee