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
最佳答案
您正在使用sqlserver提供程序,该程序不允许您创建文件。 call
Get-ChildItem 'SQLSERVER:\SQLREGISTRATION' -Recurse | export-csv C:\reorder.csv
关于powershell - Powershell导出到.csv文件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9323850/