Unable to view output table in RichTextBox

Welcome Forums General PowerShell Q&A Unable to view output table in RichTextBox

Viewing 5 reply threads
  • Author
    Posts
    • #259675
      Participant
      Topics: 4
      Replies: 7
      Points: 58
      Rank: Member

      Hi

      I am trying to view the services in RichTextBox but failed to do so.
      Can someone point me the right direction? Below is the code.

      • This topic was modified 3 weeks, 6 days ago by mrdon03.
      • This topic was modified 3 weeks, 6 days ago by grokkit.
    • #259882
      Participant
      Topics: 0
      Replies: 47
      Points: 448
      Helping Hand
      Rank: Contributor

      First of all, Format-Table is used only to format output in the interactive console session.

      One if the options would be to loop through your $sqlservices object and append/format every value manually using spaces new lines and tabs.

      Another option would be to use RTF (Reach Text Format) codes to generate a table inside reach text box:

      https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxrtfcp/65dfe2df-1b69-43fc-8ebd-21819a7463fb

      Hope that helps.

       

       

       

    • #261404
      Participant
      Topics: 4
      Replies: 7
      Points: 58
      Rank: Member

      Hi Andy,

      Do you mind showing me example for the first method? loop through $sqlservices object and append/format every value manually using spaces new lines and tabs.

      Thank you

    • #261425
      Participant
      Topics: 4
      Replies: 7
      Points: 58
      Rank: Member

      First of all, Format-Table is used only to format output in the interactive console session.

      One if the options would be to loop through your $sqlservices object and append/format every value manually using spaces new lines and tabs.

      Another option would be to use RTF (Reach Text Format) codes to generate a table inside reach text box:

      https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxrtfcp/65dfe2df-1b69-43fc-8ebd-21819a7463fb

      Hope that helps.

      Hi Andy

      I came out with below code. I am trying to use the first method u suggest. It is still not working.

      • This reply was modified 2 weeks, 5 days ago by mrdon03.
      • This reply was modified 2 weeks, 5 days ago by grokkit.
    • #261707
      Participant
      Topics: 0
      Replies: 47
      Points: 448
      Helping Hand
      Rank: Contributor

      Hello Muhammad,

      Here is quick and dirty way to accomplish this:

      Probably it would be better to at least wrap all this formatting stuff in separate function.

      Hope that helps.

    • #261953
      Participant
      Topics: 0
      Replies: 47
      Points: 448
      Helping Hand
      Rank: Contributor

      As discussed added loop for multiple $sqlservices:

      Hope that helps.

      • This reply was modified 1 week, 6 days ago by grokkit. Reason: code formatting - please read the guide
Viewing 5 reply threads
  • You must be logged in to reply to this topic.