I'm very new to using powershell, and I'm trying to convert the output of an exe to an object\table\something_useful to be able to loop through the data. I've found code converting if the data is horizontal, but not if it is vertical.
The output looks like this:
UNC Path: None
LUN Path: blah1:blah/blah
Storage System: blah1
If there are two connected, then it looks like this:
UNC Path: None
LUN Path: blah1:blah/blah
Storage System: blah1
UNC Path: None
LUN Path: blah2:blah/blah
Storage System: blah2
I'm hoping to get something that looks like the following:
UNC Path LUN Path Storage System
-------- -------- --------------
None blah1:blah/blah blah1
None blah2:blah/blah blah2
What I have tried:
sdcli.exe disk list | Tee-object -Variable DiskList
echo $DiskList
The output looks like this:
UNC Path: None
LUN Path: blah1:blah/blah
Storage System: blah1
If there are two connected, then it looks like this:
UNC Path: None
LUN Path: blah1:blah/blah
Storage System: blah1
UNC Path: None
LUN Path: blah2:blah/blah
Storage System: blah2
I'm hoping to get something that looks like the following:
UNC Path LUN Path Storage System
-------- -------- --------------
None blah1:blah/blah blah1
None blah2:blah/blah blah2
What I have tried:
sdcli.exe disk list | Tee-object -Variable DiskList
echo $DiskList