我想读取数据并使用PowerShell将其写入到.txt文件中。 但在结果它被修剪。在PowerShell中格式化数据
#Get the photo path of the students
$commandAD = $connection.CreateCommand()
#Retreving student photo records.
$commandAD.CommandText = "SELECT [Barcode],[ImageURL] FROM
[iSAMS_Custom].[dbo].[vwDestinyLibrary_Student_photo1]"
$resultPhoto = $commandAD.ExecuteReader()
$tablePhoto = new-object "System.Data.DataTable"
$tablePhoto.Load($resultPhoto)
#Export Hash Table to Txt File
$tablePhoto | Out-File c:\Users\nimmy.pk\Documents\inputphoto.txt
如何格式化数据?
也许它保存为CSV,好像对象是表 – guiwhatsthat
我需要的结果作为txt格式 –