locked
Merging Multiple Rows to 1 Line RRS feed

  • Question

  • Hi all

    I am writing a script that has interogated SSCM and has given me a list with computers and what collections they are a member of. I am trying to tidy this up but I dont know how to merge the collections into 1 line

    I have written the first part its just the next part im stuck on.

    Example of what I am trying to achieve....unless someone has a better way. Please help Thanks

    Results

    Computer        Collections                                            
    --------            -----------                                            
    COMPUTER1     All Systems                                            
    COMPUTER1     All Desktop and Server Clients                                                                
    COMPUTER1     All UK Servers                                         
    COMPUTER_02     All Systems                                                                                   
    COMPUTER_02     All UK Servers                                         
    COMPUTER_02     All Brs Servers                                                            
    COMPUTER_02     All CSE Servers                                   

    What Im trying to Acheive

    Computer          Collections                                            
    --------              -----------
    COMPUTER1       All Systems, All Desktop and Server Clients, All UK Servers
    COMPUTER_02    All Systems, All UK Servers, All Brs Servers, All CSE Servers 



    • Edited by ktitchard Thursday, October 19, 2017 2:32 PM
    Thursday, October 19, 2017 2:30 PM

All replies

  • You should share your "first part" please. Then we might help you much better than starting from scratch.

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

    Thursday, October 19, 2017 2:38 PM
  • Look at this command:

    help Group-Object -online


    \_(ツ)_/

    Thursday, October 19, 2017 2:47 PM