Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell将导入的XML格式化为数据表_Xml_Powershell_Datatable - Fatal编程技术网

Powershell将导入的XML格式化为数据表

Powershell将导入的XML格式化为数据表,xml,powershell,datatable,Xml,Powershell,Datatable,我正在使用Powershell导入XML文件,我想将数据格式化为datatable 使用下面的问题,我可以在powershell控制台中以表格的形式查看数据 我根据这个问题生成的powershell如下所示 $peakPrices = $dt.heml.Transactions.Record | format-table -AutoSize -Property @{Label="Period";Expression={$_.column[0]."#text"}}, @{label="Peaks

我正在使用Powershell导入XML文件,我想将数据格式化为datatable

使用下面的问题,我可以在powershell控制台中以表格的形式查看数据

我根据这个问题生成的powershell如下所示

$peakPrices = $dt.heml.Transactions.Record | format-table -AutoSize -Property @{Label="Period";Expression={$_.column[0]."#text"}},
@{label="PeaksBid";Expression={$_.column[9]."#text"}}, @{label="PeaksOffer";Expression={$_.Column[11]."#text"}}, @{label="ReportDate";Expression={$todaysDate}}
这将以表格的形式生成一个很好的数据视图,但我似乎不能用它做我想做的事情,即循环每一行并做一些事情

上面代码的结果表与此类似


我想将此数据更改为datatable,因为我能够处理这些数据。这是我能做的吗?

格式表
将返回预格式化的数据,以便在主机应用程序中显示。如果要选择计算特性进行进一步处理,请使用
选择对象

... | Select-Object -Property @{Label="Period";Expression={$_.column[0]."#text"}},@{label="PeaksBid";Expression={$_.column[9]."#text"}}, @{label="PeaksOffer";Expression={$_.Column[11]."#text"}}, @{label="ReportDate";Expression={$todaysDate}}

使用
Select Object
而不是
Format Table
spot on thanky you,我如何将此标记为已回答?