sirbounty
asked on
Powershell logic
Need to make sure I'm thinking this through.
If a criteria is true, then I need to perform another test, otherwise perform the default test.
Thus, I need to drop out of an if statement, but continue my foreach....is break the statement I need for this?
If a criteria is true, then I need to perform another test, otherwise perform the default test.
Thus, I need to drop out of an if statement, but continue my foreach....is break the statement I need for this?
foreach ($cog in $widgests) {
if ($something -eq $true) {
if ($something else -eq $true) {
#do something
} else {
#This is bad - don't even try the additional tests
break; #??
}
} else {
if ($test -eq $true) {write-host 'All is right with the world'} else {write-host 'Who moved my cheese?'}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.