Good afternoon everyone :) I know practically nothing about powershell I'm testing the following code (It's a test)
$java = Test-Path -Path "C:\Program Files (x86)\Java\jre1.8.0_321/README.txt" -PathType Leaf
if ($java -eq False)
{
Write-Output "No Instalanda"
}
elseif ($java -eq True)
{
Write-Output "Instalada"
}
pause
I create a variable with a command and with if and elseif I check if it is equal to True or False and according to the output I show a message. There is no way to make it work. If I put True or False in quotes, it always gives me an error.
What's wrong with the example I gave? Thank you all