将数组转换为字符串

将数组转换为字符串,然后输出到CSV

 1 [array]$array = "abc","dee","riwo"
 2 #将数组转换为字符串
 3 $b=$array -join "`n" 
 4 
 5 $r=$null
 6 $r = ""|select a,b
 7 $r.a = "aa"
 8 $r.b = $b
 9 
10 $r|export-csv d:\aaa.csv -NoTypeInformation -Encoding default

结果:

 

posted on 2014-11-10 15:27  momingliu11  阅读(388)  评论(0编辑  收藏  举报