Need Help Modifing a PowerShell Script

Greeting Experts,
I hope somebody out there can give me and hand with this script. Currently the script below works as is with no problem.  It creates 5 different .csv files for each of its assigned processes…. What I need to do know is combine all 5 of the .csv files in to one… but I not for sure on how to do that. Can somebody give me hand in this step…..? I just not sure how to combine them together….

Push-location $env:temp
Get-Process | Export-Csv "c:\PSscripts\Processes.csv"
Get-Service | ? {$_.status -eq "running"} | Export-Csv "c:\PSscripts\ActiveServices.csv"
Get-WmiObject -Class Win32_operatingsystem | Select -Property * | Export-Csv "c:\PSscripts\OSInfo.csv" 
"10.20.0.92", "10.20.3.10", "10.20.0.80", "10.40.4.10" | % {  pathping -n -p 10 $_} | Out-File "c:\PSscripts\InternalPing.csv"
"www.yahoo.com", "www.bing.com", "google.com", "www.hubbell.com" | % {  pathping -n -p 10 $_}  | Out-File "c:\PSscripts\ExternalPing.csv"

Open in new window

MikeSecurityAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
As said in the prior thread, I think you are suffering from a misconception. A CSV is a structured file, having one kind of info only. You can't put rows with different meaning into a single CSV (and keep it a valid CSV). Of course you can treat the CSV as a simple text file, but you are loosing the structure that way. Structured data allows for better processing (but have worse visible clarity).

What is the exact reason you cannot stay with the "one file, one info type" paradigma?

To show what I'm talking about, this is how it looks if everything is written into a single text file:
Get-Process | Out-File "C:\PSSripts\Diag-Result.txt"
Get-Service | ? {$_.status -eq "running"} | Out-File "C:\PSSripts\Diag-Result.txt" -Append
Get-WmiObject -Class Win32_operatingsystem | Select -Property * | Out-File "C:\PSSripts\Diag-Result.txt" -Append
"10.20.0.92", "10.20.3.10", "10.20.0.80", "10.40.4.10" | % {  pathping -n -p 10 $_} | Out-File "C:\PSSripts\Diag-Result.txt" -Append
"www.yahoo.com", "www.bing.com", "google.com", "www.hubbell.com" | % {  pathping -n -p 10 $_}  | Out-File "C:\PSSripts\Diag-Result.txt" -Append

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MikeSecurityAuthor Commented:
OK.... Is there away to covert the the script so I am able to use the data in a .csv file
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
No, for the reasons I stated above.
MikeSecurityAuthor Commented:
well... I gess the .txt format will do... thanks for your help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.