Table creation in powershell by creating a function



I'm a newbie to powershell. Im trying to create a function in powershell which will help me to create a table.

Can someone let me know how its done





  • Hello Atulyan,

    First of all welcome to these forums, glad to have you here. It is good to see you are interested in learning PowerShell.

    Now to your question, what kind of table are you referring too, your question is a bit unclear. Could you please elaborate on what you are trying to do and what kind of table you would like to generate?

    An example of displaying information in PowerShell using the Format-Table cmdlet:

    Get-Service | Format-Table -Autosize

  • Hi Jaap,


    Thnx for your prompt reply. I'm trying to create a function in powershell called companytable which will have 2 columns 'CompanyName' and 'CompanyId'.


    Once this is created, it should reflect on my sql 2012 express edition on my local machine