PowerShell腳本Foreach循環不導出爲CSV文件
$(foreach ($k in $sql_output){
$ip = $k[0]
$present = $k[1]
write-output $ip, $present
}) | export-csv D:\Script\is_present.csv
我希望is_present.csv看起來像
10.10.10.10 1
10.10.10.11 1
10.10.10.12 0
相反,它看起來像
#TYPE System.DBNull
如何解決?
此答案最有幫助 – Glowie 2014-10-14 16:55:22