1

I just ran into what I think is a very strange issue, but it's very possible I'm just doing something wrong.

When I run this code:

Function OutOfOrder($animal,$verb,$adjective) {
@"
The quick brown $animal $verb over the $adjective dog
"@
}

OutOfOrder("fox","jumped","lazy")

This is the output I receive:

The quick brown fox jumped lazy  over the  dog

Behavior is the same in PS 2.0 and 3.0. What gives?

Thanks!

1 Answer 1

2

This is a common mistake. You shouldn't use parens and commas when calling a powershell function.

You passed an array of 3 strings to the first parameter and the other 2 came across empty.

Try this:

 OutOfOrder "fox" "jumped" "lazy" 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.