Last active
September 5, 2015 17:56
-
-
Save dmalikov/ab8089754ef86a72497a to your computer and use it in GitHub Desktop.
Meanwhile on the Planet of Adequate Programming Languages
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
################## PART ONE | |
> ("a" + "b" * 3).length | |
4 | |
> ("a" + , "b" * 3).length | |
6 | |
################## PART TWO | |
> if (2 > 1) { echo "two is larger than one" } else { echo "no it is not" } | |
no it is not | |
################## PART THREE | |
> if ("this string contains letter A" -contains "A") { echo "yep" } else { echo "but actually it does not" } | |
but actually it does not | |
################## PART FOUR | |
$ cat test.ps1 | |
function add([int] $x, [int] $y) { | |
return $x + $y | |
} | |
Write-Host (add(1,2)) | |
$ powershell ./test.ps1 | |
add : Cannot process argument transformation on parameter 'x'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Int32". | |
At test.ps1:5 char:16 | |
+ Write-Host (add(1,2)) | |
+ ~~~~~ | |
+ CategoryInfo : InvalidData: (:) [add], ParameterBindingArgumentTransformationException | |
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,add |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@RamblingCookieMonster
Thanks 👍