I have a variable $c.
$c returns
apples
oranges
bananas
How can I make these separate objects?
$fruit = $C | foreach { $_ -like 'oranges'}
if($fruit)
{
write-host "Success" -ForegroundColor Green
}
else
{
write-host "Failed" -ForegroundColor red
}
This doesnt work unless I use wildcards?
Im trying to get an exact match checking each line.
Any help is appreciated. I'm stuck on this one.
C$in the question. Chances are you need to get$C.Content | ConvertFrom-Jsonto get an object that has your apples, bananas and other fruits.