Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powershell - convert string to table or other object?

Status
Not open for further replies.

torq

Technical User
May 1, 2008
1
US
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
 
What does the code that creates the output look like?


Light travels faster than sound. That's why some people appear bright until you hear them speak.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top