locked
Adjust cmdlet output display RRS feed

  • Question

  • Hi,

    I am using O365ServiceCommunications module of power-shell for retrieving Office 365 message center and exporting out same in csv however the format of output is displaying one property details after another vertically that barely makes it difficult to filer / read  out any information in csv later ... I need information to go horizontally much like a table having unique property name and underneath its details :-

    Desired output sample:

     

    Currently I am using below cmdlet :

    Get-SCEvent -EventTypes Message -PastDays 20 -SCSession $session |Select-Object Id, Title,StartTime,endtime,lastupdatedtime,actiontype,externallink, @{n='Message';e={$_.messages[0].messagetext}}

    Do note : - using following cmdlet partially servers the purpose however output strips out larger messages as :(

    Message         : We have maintenance planned for Skype for Business...

    Get-SCEvent -SCSession $Session -EventTypes Incident -PastDays 2

    Current output:-

    Id
    Title
    StartTime
    EndTime
    LastUpdatedTime
    ActionType
    ExternalLink

    Example output - 

    Id              : MCXXXX
    Title           : Planned Maintenance: Skype for Business
    StartTime       : X/X/20XX 6:19:06 PM
    EndTime         : X/X/20XX 11:59:00 PM
    LastUpdatedTime : X/X/20XX 6:19:06 PM
    ActionType      : Awareness
    ExternalLink    : 

    Message         : We have maintenance planned for Skype for Business........ 

    Kindly suggest 


    Aditya Mediratta



    Monday, June 25, 2018 1:36 PM

All replies

  • You could use Export-CSV to create CSV files for later use or you can use format cmdlets like Format-Table.

    ... and you should start to learn the basics of Powershell.


    Best regards,

    (79,108,97,102|%{[char]$_})-join''


    • Edited by BOfH-666 Monday, June 25, 2018 2:35 PM
    Monday, June 25, 2018 2:34 PM
  •    

    BOfH_66

    Thanks for your response , could you give me an example in reference to following cmdlet .. I'll try out now and give you confirmation for same.

    Get-SCEvent -EventTypes Message -PastDays 20 -SCSession $session |Select-Object Id, Title,StartTime,endtime,lastupdatedtime,actiontype,externallink, @{n='Message';e={$_.messages[0].messagetext}}


    Aditya Mediratta

    Monday, June 25, 2018 2:56 PM
  • ...  could you give me an example in reference to following cmdlet ....
    No. If you're not able to use the Powershell pipeline to combine two cmdlets with each other you should stop claiming that you are [ MCSE Messaging ], [MCSE Communication ] , [ MCSE Productivity ], [ MCSA Office 365 ], [ MCSA Windows Server 2012]  and so on and should finally start to learn the basics of Powershell.  ;-) :-D  :-*

    Best regards,

    (79,108,97,102|%{[char]$_})-join''

    Monday, June 25, 2018 3:08 PM
  • I am well aware of pipelines and export cmdlets but I bet this not what is desired out of expected output .. that was the only reason I mentioned you to state me exact cmdlet so that I can paste in my output & about my certifications , I don't need to prove my technical abilities to crap like you BOfH 


    Aditya Mediratta

    Monday, June 25, 2018 3:21 PM
  • I am well aware of pipelines and export cmdlets but I bet this not what is desired out of expected output .. that was the only reason I mentioned you to state me exact cmdlet so that I can paste in my output & about my certifications , I don't need to prove my technical abilities to crap like you BOfH 


    Aditya Mediratta

    The CmdLet was posted .  Use "Export-Csv" to get a file.

    help Export-Csv -online

    As noted above, just add it to the end of the pipeline.

    Read the examples in the help for more detailed usage.


    \_(ツ)_/

    Monday, June 25, 2018 4:53 PM