Hi guys
I hope you can help me!
Let's say I have this:
$XXX = "TTT" $Department = "XXX - Hello" $Test = ($Department.Split(" "))[0] If($($Test) -eq "TTT") {Write-Host "Does it work?"}The If statement is the problem. I would like for it to replace $($Test) with $XXX and then check if that variable exists. But while $Test returns the string "XXX" it doesn't seem to accept that I want to insert a $ sign in front and check if this variable exists. Is there some way of doing this, that I'm just not seeing? I've tried writing it a bunch of different ways without any luck.