lundi 28 septembre 2015

Why can't I break my powershell command into multiple lines?

This works (all on one line):

PS C:\> $list.item | % { $t = $_.tags -split ","; if ($t -contains "red") { $_.name } }

This, however, doesn't:

PS C:\> $list.item | % {
>> $t = $_.tags -split ","
>> if ($t -contains "red") { $_.ne }
>> }
>>

No matter what I enter, I just keep getting the ">>" prompt until I hit Ctrl-C.

What's wrong?

Aucun commentaire:

Enregistrer un commentaire