I'm trying to create a powershell script that has an if statement depending on what a variable starts with basically.
I have this code:
if($content -contains "fail*") {
#Not all ID's exist/could not be created. pop up error code :(
"match"
} else {
#At this point, we should have a list of hardware id's identifier from our database.
"no match"
}
The powershell $_POST
's data to my server, for a response. If that response starts with fail
it should go down the first branch, if it returns anything else, it should go down the other branch.
My PHP code can only return 1 result right now, as I was testing this. This is my php code:
<?
include("db-connector.php");
echo "fail - ".$_POST['device'];
?>
The included file contains no output. As you can see, the result should ALWAYS go down the fail branch, but it actually doesn't. Why am I getting this result?