I have a script which pulls variables and compares them against each other. Most of them works perfectly fine, but there seems to be a problem with this particular variable.
secedit /export /cfg C:\secedit.txt
$var = import-csv C:\secedit.txt
$holding = $var[4] -match "(\d+)"
$a=$matches[1]
Assuming $var[4] is
Maximum Password Length = 100
$a will be 100
But when I do a comparision with
if($a -gt 50){"true"}
My result will be false.
After troubleshooting, only if the value is 1, then it will be recognised as true.
However, doing mathematical operations such as $a/5 $a-1 all willl result in correct values with 20 and 99 respectivly.
Can someone explain this?