【发布时间】:2018-03-15 00:44:52
【问题描述】:
寻找比较两个 system.objects 的最佳方法。尝试了 compare-object 选项,似乎没有给出所需的输出..
> $abc
BGP summary information for VRF default
Router identifier 192.168.0.3, local AS number 7251
Neighbor Status Codes: m - Under maintenance
Neighbor V AS MsgRcvd MsgSent InQ OutQ Up/Down State PfxRcd PfxAcc
10.12.103.119 4 7251 0 0 0 0 5d23h Connect
10.46.252.121 4 7251 0 0 0 0 5d23h Connect
> $def
BGP summary information for VRF default
Router identifier 192.168.0.3, local AS number 7251
Neighbor Status Codes: m - Under maintenance
Neighbor V AS MsgRcvd MsgSent InQ OutQ Up/Down State PfxRcd PfxAcc
10.12.103.119 4 7251 0 0 0 0 5d23h Active
10.46.252.121 4 7251 0 0 0 0 5d23h Estab
> $abc.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
> $def.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
> Compare-Object -ReferenceObject $abc -DifferenceObject $def
InputObject
-----------
BGP summary information for VRF default...
BGP summary information for VRF default...
【问题讨论】:
标签: powershell compare