Scenario
When my variable (called $Numbers) contains 0, 1 and 2, it'll run anything under the first IF statement. If my variable contains 0, 1, 2 and 3, it'll run the other IF statement.
Issue
I can't seem to get this working since it continuously runs the first IF statement (due to still containing 0, 1 and 2) but never skips this if it doesn't contain the number 3.
Brief Code Example
If ($Numbers -contains "*0,*" -and "*1,*" -and "*2,*") {
Write-Host = "Does not contain 3"
}
Elseif ($Numbers -contains "*0,*" -and "*1,*" -and "*2,*" -and "*3,*") {
Write-Host "Contains 3"
}
Any guidance is appreciated.