简体   繁体   English

将Powershell脚本导出到CSV列

[英]Exporting Powershell Script to CSV columns

We are moving to a new file share location and we are trying to pull all of the current mapped drives on the domain by using a logon script that is utilizing netuse. 我们将移至新的文件共享位置,并且尝试通过使用利用netuse的登录脚本来拉出域上的所有当前映射驱动器。

I have tried to export-csv and it does not return the correct data it just shows the length of what should be there: 我尝试export-csv ,它没有返回正确的数据,只是显示了应该存在的长度:

wmic netuse get remotename,username | out-file -append \\\\PATHTOFILE.csv

Is the entirety of the script that is running. 是正在运行的脚本的全部。

Per Ctznkane525's link: 根据Ctznkane525的链接:

You could try something like this: 您可以尝试这样的事情:

Get-PSDrive -PSProvider FileSystem | Select-Object Name,Provider | ConvertTo-Csv -NoTypeInformation | Out-File -Append "Path"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM