I am fairly new to PS so running into this problem. I have 2 variables:
$var1= "hello" $var2= "hello-2018" if ($var1 -match $var2){ #Do Something } I want to compare the two variables and if the $var1 has some parts of $var2, I want the code to do something. I’ve tried match, like, contains but not getting the desired output.
if ($var2.Contains($var1)) { }