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
Post a Comment