I have a weird issue occurring. I'm parsing a number from a name, which looks like this: ($env:COMPUTERNAME).Substring(11, 2)
. Said name is usually like abcxyzhij099w. I'm getting the 99
in that example. I then evaluate it using a series of -gt
-lt
calls, for example elseif ($time -ge 60 -and $time -lt 120)
.
My problem is that I'm currently evaluating the number 62
. It successfully evaluates that it's less than 70
, 99
, and 620
, but anything between 100
and 619
fails. I've included an image but I'm at a loss to why this would happen. Manually setting $time
to 62
allows all checks to pass, but parsing from the name causes it to fail.
I've verified it's length is 2, and gm
shows it as a system.string
. I imagine I'm just missing something incredibly small but I haven't run into this before. Any assistance would be appreciated!