An ElseIf clause adds a conditional branch to an If construct. It has its own expression and script block, which runs only when its expression is true and earlier conditions were false. section 5.2
If (<expression>) {
# code
} ElseIf (<expression>) {
# code
} ElseIf (<expression>) {
# code
} Else {
# code
}
Use multiple ElseIf clauses to test conditions in sequence. PowerShell stops at the first true expression, runs that script block, and skips the remaining branches. section 5.2
Choose one action
An ElseIf chain can separate high, low, and default cases: If ($proc.vm -gt 4) { take some action } ElseIf ($proc.vm -lt 2) { take some other action } Else { do nothing }. Only the first true branch executes. section 5.2


