Wednesday, April 13, 2011

Passing quoted arguments

In PowerShell when you need to pass arguments with spaces in them, you typically quote the phrase that is your argument:

write-host "hello world"

Prints: hello world

But how do you print “hello world”?

You use triple quotes: write-host """hello world"""

No comments:

Post a Comment

Remember, if you want me to respond to your comment, then you need to use a Google/OpenID account to leave the comment.