Created
October 22, 2015 20:05
-
-
Save bklockwood/ee76c76cb57057e2da50 to your computer and use it in GitHub Desktop.
comparison operator in switch statement
This file contains hidden or 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
$size = $(get-item .\Rootstore.sst).Length | |
Write-Host "Size $size" | |
switch ($size) { | |
($_ -gt 30000000000) {$foo = "reallybig" ;break} | |
($_ -lt 25000000000) {$foo = "size5" ;break} | |
($_ -lt 20000000000) {$foo = "size4" ;break} | |
($_ -lt 15000000000) {$foo = "size3" ;break} | |
($_ -lt 10000000000) {$foo = "size2" ;break} | |
($_ -lt 5000000000) {$foo = "size1" ;break} | |
} | |
Write-Host "the file is: $foo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment