Powershell导出到.csv文件错误

时间:2012-02-17 06:26:49

标签: powershell ssms powershell-v2.0

PS SQLSERVER:\sqlregistration> Get-ChildItem 'SQLSERVER:\SQLREGISTRATION' -Recurse | export-csv reorder.csv
Export-Csv : Cannot open file because the current provider (SqlServer) cannot open a file
.
At line:1 char:65
+ Get-ChildItem 'SQLSERVER:\SQLREGISTRATION' -Recurse | export-csv <<<<  reorder.csv
    + CategoryInfo          : InvalidArgument: (:) [Export-Csv], PSInvalidOperationExcep
   tion
    + FullyQualifiedErrorId : ReadWriteFileNotFileSystemProvider,Microsoft.PowerShell.Co
   mmands.ExportCsvCommand

1 个答案:

答案 0 :(得分:4)

您在sqlserver提供程序上,不允许您创建文件。致电

Get-ChildItem 'SQLSERVER:\SQLREGISTRATION' -Recurse | export-csv C:\reorder.csv