powershell if statement examples
Example 1: powershell if operator
if (condition1 -eq condition2) {
//statement
} else {
//statement
}
-eq Equals to
-ne Not equal to
-gt Greater than
-ge Greater than or equal to
-lt Less than
Example 2: powershell else if
if (condition) {
# Whatever
}
elseif (condition) {
# Whatever
}