Which type to use?

Welcome Forums General PowerShell Q&A Which type to use?

This topic contains 1 reply, has 2 voices, and was last updated by

1 year, 6 months ago.

  • Author
  • #78487

    Points: 0
    Rank: Member

    I want to return a 'table' which is the response from a SQL query. I will need to manually create the data as the SQL comes from an unmanaged type from a COM object as it reads a special file not a sql server. So I can pick any data type.

    What data type should I use in order to be able to work with the data using standard sort and format cmdlets?

  • #78650

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    PSCustomObject. Add each column to an object as a property, and emit a new object for each row. I'd create a dedicated function to do just that – a la, ConvertFrom-MyGoofyCOMThing.

The topic ‘Which type to use?’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort