I am trying to check whether the system has a particular environment variable value that contains a particular string; e.g.:
C:\Program Files\Java\jre1.8.0_271\bin
I found how to check whether an environment variable exists or not:
if ([Environment]::GetEnvironmentVariable('path', 'Machine'))
{
"Exist in the system!"
}
This works, but I need to know how to check whether the value contains a particular substring or not.