尝试执行Select-Object,但是我似乎无法从键值列表属性返回属性和值。我想从此Parameters属性中返回3个属性RunRun,Message和'tableName'。
我对此有太多:
|Select-Object -Property Parameters,RunStart,Message
Parameters RunStart Message
---------- -------- -------
{[tableName, AHROR012], [schemaName, dbo]...} 11/14/2019 5:39:06 PM Operation on target failed
但是我这样做时没有得到RunStart或Message:
|Select-Object -ExpandProperty Parameters -Property tableName,RunStart,Message
Key Value
--- -----
tableName AHROR012
我该如何获得:
Parameters.tableName RunStart Message
---------- -------- -------
AHROR012 11/14/2019 5:39:06 PM Operation on target failed
谢谢!!!
最佳答案
... | Select-Object -Property @{
Name='ParametersTableName';
Expression={ $_.Parameters.tableName }
}, RunStart, Message
关于powershell - Powershell选择对象属性和expandproperty,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58881769/