将数组转换为字符串,然后输出到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
结果:
本文共 224 字,大约阅读时间需要 1 分钟。
将数组转换为字符串,然后输出到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
结果:
转载地址:http://vmuna.baihongyu.com/