Automation

 View Only
  • 1.  Get-Datastore - format screen output as Tab Seperated Value (TSV)

    Posted Nov 08, 2018 05:19 PM

    My command below runs fine....

    Get-Cluster BoateyMcBoateyFace | Get-Datastore

    It get's me a list of all the datastores in that cluster "BoateyMcBoateyFace".

    What I need is to format the output it gives me in a tab separated value on the screen. Not to a text file.

    A little unorthadoxed from the norm but that's just me. (◔/‿\◔)

    Also, if possible get it without the label headers. This will make it easier for me to parse through the output in Visual Studio.

    Thanks in advanced.



  • 2.  RE: Get-Datastore - format screen output as Tab Seperated Value (TSV)

    Posted Nov 08, 2018 05:25 PM

    Why not to use select * and choose the specific values under output.



  • 3.  RE: Get-Datastore - format screen output as Tab Seperated Value (TSV)
    Best Answer

    Posted Nov 08, 2018 05:26 PM

    You mean like this?

    Get-Cluster BoateyMcBoateyFace| Get-Datastore | Format-Table -HideTableHeaders



  • 4.  RE: Get-Datastore - format screen output as Tab Seperated Value (TSV)

    Posted Nov 08, 2018 06:34 PM

    That got me the stripped out header output I wanted.

    Is it possible to format the output in Tab Separated Value?

    The output now is padded with spaces.

    Thanks



  • 5.  RE: Get-Datastore - format screen output as Tab Seperated Value (TSV)

    Posted Nov 08, 2018 10:27 PM

    I went ahead and wrote VB .Net code to parse out the data I needed.

    Thanks