I am having an issue comparing IE versions with PowerShell.
I have the code below :
$CurVersion = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Internet Explorer').Version
Write-Host "Current Version Of IE is $CurVersion"
IF ($CurVersion -gt "11.*")
{
"IE is up to date"
}
ELSE
{
"IE needs to be updated"
}
However, this code doesn't work because $curversion is stored as a string. 9.11.9600.17914 IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String System.Object
I can remove part of the version number, convert that to int and compare it that way but I'm sure there must be a easier and simpler way.
Can someone help me with this?
Thanks in advance.