Powershell to select columns from csv when condition matches -


my csv looks this

svndirectory    release export          yes import service         yes 

my script should select svndirectory names whole release value "yes" , store in array.

script

$svndirectory = import-csv  training.csv | % {$_.svndirectory -and $_.release -eq "yes"} write-host $svndirectory       

without , condition script works fine. selects svndirectory names , stores in array. when give condition, returns true false true instead of svndirectory filed value. can please let me know missing here. new powershell.

my expected output $svndirectory = export   service 

this worked

   $file = import-csv training.csv    $svndirectory = $file | where-object{$_.release -eq "yes"} | %  {$_.svndirectory}     write-host $svndirectory 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -