Created
February 28, 2018 19:23
-
-
Save Sambardo/646c7f759f3e3859d33d4da47e258833 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$nums = 1..15 | |
foreach($num in $nums) | |
{ | |
Switch($num) | |
{ | |
{$num -lt 5} {write-host "$num is less than 5!" -ForegroundColor Magenta} | |
{$num -lt 10} {write-host "$num is less than 10!" -ForegroundColor green} | |
{$num -lt 15} {write-host "$num is less than 15!" -ForegroundColor cyan} | |
default {write-host "$num is greater than or equal to 15" -ForegroundColor yellow} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment