Created
August 17, 2017 13:31
-
-
Save MathieuBuisson/997391c2bf5e5480fce5add401cfb4ee to your computer and use it in GitHub Desktop.
Dummy function to test PowerShell code complexity measurement
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
| Function Test-Conditional { | |
| [CmdletBinding()] | |
| Param( | |
| [int]$IfElseif | |
| ) | |
| # Testing nested If statement | |
| If ( $IfElseif -gt 20 ) { | |
| If ( $IfElseif -gt 40 ) { | |
| Write-Host 'IfElseif is between 20 and 40' | |
| } | |
| Else { | |
| Write-Host 'IfElseif is greater than 40' | |
| } | |
| } | |
| Else { | |
| If ( $IfElseif -ge 10 ) { | |
| Write-Host 'IfElseif is a 2 digit number' | |
| } | |
| Else { | |
| #Testing For statements | |
| For ($i = 1; $i -lt 99; $i++) { | |
| Write-Host "$($IfElseif + $i)" | |
| For ($j = 0; $j -lt 10; $j++) { | |
| Write-Host "$($IfElseif - $j)" | |
| } | |
| } | |
| For ($k = 1;;$k++) { | |
| Write-Host 'No Condition for this loop' | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment