Powershell is doing what is expected here since your loop calls Get-VBRTaskSession multiple times, so it's printing the output for each item in your array individually.
Then you should get your single list like you're hoping. We initialize an empty array to add some items to, then use += to add new data to that array and simply print the array at the end.
David Domask | Product Management: Principal Analyst
Name Result StartTime EndTime Backup Size MB
---- ------ --------- ------- --------------
89-rhel6 Success 2024-03-19 오전 11:13:39 2024-03-19 오전 11:20:10 6087.18
84-cvt Warning 2024-03-19 오후 10:00:41 2024-03-19 오후 10:05:05 2052.88
84-cvt Warning 2024-03-20 오후 10:00:43 2024-03-20 오후 10:07:07 6468.77
84-cvt Warning 2024-03-18 오후 10:00:52 2024-03-18 오후 10:07:16 1851.56
83-win Warning 2024-03-16 오후 10:00:55 2024-03-16 오후 10:05:17 182.39
84-cvt Warning 2024-03-17 오후 10:00:57 2024-03-17 오후 10:05:20 2098.64
83-win Warning 2024-03-17 오후 10:01:02 2024-03-17 오후 10:05:25 326.45
so, i have a question more.
Is it Possible 'Name' in descending order? or ascending
Name Result StartTime EndTime Backup Size MB
---- ------ --------- ------- --------------
83-win Warning 2024-03-17 오후 10:01:02 2024-03-17 오후 10:05:25 326.45
83-win Warning 2024-03-16 오후 10:00:55 2024-03-16 오후 10:05:17 182.39
84-cvt Warning 2024-03-19 오후 10:00:41 2024-03-19 오후 10:05:05 2052.88
84-cvt Warning 2024-03-20 오후 10:00:43 2024-03-20 오후 10:07:07 6468.77
84-cvt Warning 2024-03-18 오후 10:00:52 2024-03-18 오후 10:07:16 1851.56
84-cvt Warning 2024-03-17 오후 10:00:57 2024-03-17 오후 10:05:20 2098.64
89-rhel6 Success 2024-03-19 오전 11:13:39 2024-03-19 오전 11:20:10 6087.18
Glad you figured it out shahn I'm guessing you just piped to Sort-Object -Property Name, correct?
Any time you need to do sorts, just pipe the array/list/whatever to Sort-Object it will set you right. You can also use Group-Object, but this will return a very specific object, so play with it a bit and get a feel for how it does the sorting (it's very similar in my mind to Pivot Tables from Excel if that helps your mental model)
David Domask | Product Management: Principal Analyst