Simple Powershell script:
$key = Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager"
$bootexecute = $key.BootExecute
write-host $bootexecute
if ($bootexecute -eq "autocheck autochk *") {
return $false
} else {
return $true
}
This is What I'm getting as output:
autocheck autochk /r \??\C: autocheck autochk *
False
So even though the $bootexecute variable does not exactly equals "autocheck autochk *" I still get "False" as a result, whereas it should return "True" here.
What's going on, what am I missing here?
Edit, to clarify: I literally want to check for the string "autocheck autochk *". Asterisk included.
$bootexecuteis being returned as an string array, BTW.