I have an annoying report output (curse be to HP) that is not something I can shape by a query - it's all or nothing more or less. I would like to take two lines from each "chunk" of output and construct an array from this. I figured it would be a simple split() operation but no such luck. A sample of the output is as so:
Medium identifier : 1800010a:54bceddd:1d8c:0007
Medium label : [ARJ170L6] ARJ170L6
Location : [TapeLibrary: 24]
Medium Owner : wfukut01
Status : Poor
Blocks used [KB] : 2827596544
Blocks total [KB] : 2827596544
Usable space [KB] : 1024
Number of writes : 16
Number of overwrites : 4
Number of errors : 0
Medium initialized : 19 January 2015, 11:43:32
Last write : 26 April 2016, 21:02:12
Last access : 26 April 2016, 21:02:12
Last overwrite : 24 April 2016, 04:48:55
Protected : Permanent
Write-protected : No
Medium identifier : 1800010a:550aa81e:3a0c:0006
Medium label : [ARJ214L6] ARJ214L6
Location : External
Medium Owner : wfukut01
Status : Poor
Blocks used [KB] : 2904963584
Blocks total [KB] : 2904963584
Usable space [KB] : 0
Number of writes : 9
Number of overwrites : 7
Number of errors : 0
Medium initialized : 19 March 2015, 10:42:45
Last write : 30 April 2016, 22:14:19
Last access : 30 April 2016, 22:14:19
Last overwrite : 29 April 2016, 13:41:35
Protected : Permanent
Write-protected : No
What would be ideal is if the final output of this work would create an array somewhat similar to this:
Location UsableSpace
--------- -------------
External 0
TapeLibrary 1024
So I can (for example) query the output so that I can do operations on the data within the array:
$myvar | where-object { $_.Location -eq "TapeLibrary" }
Perhaps there are better approaches? I would be more than happy to hear them!