0

尝试使用“PSSerializer.Deserialize(log) as PSObject;”反序列化 Powershell 日志 但不断收到错误:

"System.Xml.XmlException: 'Element 'Objs' with namespace name 'http://schemas.microsoft.com/powershell/2004/04' was not found. Line 1, position 2.'"

日志示例:

"<Obj RefId=\"0\">
    <MS>
        <Obj N=\"PowerShell\" RefId=\"1\">
            <MS>
                <Obj N=\"Cmds\" RefId=\"2\">
                    <TN RefId=\"0\">
                        <T>System.Collections.Generic.List`1[[System.Management.Automation.PSObject, System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]</T>
                        <T>System.Object</T>
                    </TN>
                    <LST>
                        <Obj RefId=\"3\">
                            <MS> ......
4

1 回答 1

0

附加这个对我有用:

<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"> 
..Log...
</Objs>
于 2020-03-23T10:52:14.420 回答