开发者

Powershell analog to 'quote words'

What is the Powershell equivalent to Perl's qw() function? In v2 I 开发者_高级运维can write my own with -split, but I'm assuming that there's an exiting method that I just can't find in the documentation.


We include this functionality in the PowerShell Community Extensions e.g.:

PS> quote-list hello world
hello
world
PS> ql hello world  # using alias
hello
world

If you don't want to install PSCX, the function is trivial:

Set-Alias ql Quote-List
function Quote-List {$args}


The built-in Write-Output cmdlet (standard alias write) works this way because the -InputObject param accepts all remaining arguments.

PS> write one two three
one
two
three
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜