![](/img/trans.png)
[英]How do I output the first negative value in a large .csv using powershell?
[英]How do I output a CSV using PowerShell without the “#TYPE” line?
这与另一篇文章有关。 我写了以下脚本:
Get-ADUser -Filter * -SearchBase 'DC=aaaa,DC=com' | Export-CSV "ADUsers.csv"
这会输出一个CSV文件,但在文件的第一行显示:
#TYPE Selected.Microsoft.ActiveDirectory.Management.ADUser"
当它试图读取它时,这会弄乱SSIS。 有没有办法不添加第一行?
添加NoTypeInformation
开关,如下所示:
Export-Csv "../SSIS/Import Data/ADUsers.csv" -NoTypeInformation
您还可以使用:
Export-Csv "../SSIS/Import Data/ADUsers.csv" -NoType
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.