Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################## 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's not" }
- no it's not
- ################## PART THREE
- > if ("this string contains letter A" -contains "A") { echo "yep" } else { echo "but actually it does't" }
- but actually it does't
- ################## PART THREE
- $ 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement