I have below sample file(s).
Symmetrix logical device count=13 CLARiiON logical device count=0 Invista logical device count=0 Generic logical device count=0 ============================================================================== ----- Host Bus Adapters --------- ------ I/O Paths ----- ------ Stats ------ ### HW Path Summary Total Dead IO/Sec Q-IOs Errors ============================================================================== 2 port2\path0 degraded 13 3 - 0 3 3 port3\path0 degraded 13 3 - 0 3 Port Attributes for 10:00:00:00:c9:69:5b:70 Node WWN : 20 00 00 00 c9 69 5b 70 Port WWN : 10 00 00 00 c9 69 5b 70 Port Symname : Emulex PPN-10:00:00:00:C9:69:5B:70 Port FCID : 78004A Port Type : Fabric Port State : Operational Port Service Type : 8 Port Supported FC4 : 00 00 01 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Port Active FC4 : 00 00 01 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Port Supported Speed: 1 2 4 GBit/sec. Port Speed : 1 GBit/sec. Max Frame Size : 2048 OS Device Name : \\.\Scsi2: Num Discovered Ports: 2 Fabric Name : 20 02 00 0d ec f1 00 c1 Port Attributes for 10:00:00:00:c9:69:37:63 Node WWN : 20 00 00 00 c9 69 37 63 Port WWN : 10 00 00 00 c9 69 37 63 Port Symname : Emulex PPN-10:00:00:00:C9:69:37:63 Port FCID : 780098 Port Type : Fabric Port State : Operational Port Service Type : 8 Port Supported FC4 : 00 00 01 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Port Active FC4 : 00 00 01 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Port Supported Speed: 1 2 4 GBit/sec. Port Speed : 1 GBit/sec. Max Frame Size : 2048 OS Device Name : \\.\Scsi3: Num Discovered Ports: 2 Fabric Name : 20 02 00 0d ec f0 b5 81
I need to select only below part in powershell. How can i achieve this? It would be great to make object form this but splitting would be enough
============================================================================== ----- Host Bus Adapters --------- ------ I/O Paths ----- ------ Stats ------ ### HW Path Summary Total Dead IO/Sec Q-IOs Errors ============================================================================== 2 port2\path0 degraded 13 3 - 0 3 3 port3\path0 degraded 13 3 - 0 3
Thanks a lot
PS.
I've tried to use below line of code but it returns not only needed block:
[regex]::match($file,'(={3,}).+(?=Port\sAttributes\sfor.+)',"singleline").value
PPS.
I'm really sorry, i'm not familiar enough with regexp, that's why i'm asking