Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7982877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:48:11+00:00 2026-06-04T10:48:11+00:00

I have two powershell cmdlets to generate process report and services report . eg:

  • 0

I have two powershell cmdlets to generate process report and services report.

eg: Get-process and Get-services

I know export-csv c:\test.csv will export the result to excel sheets.

But I need the result of the first cmdlet to export to the first sheet and the second cmdlet to second sheet of the same csv file.

How do I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:48:12+00:00Added an answer on June 4, 2026 at 10:48 am

    IMO the best option here is just to use excel automation. E.g. ConvertTo-Excel.ps1:

    param (
        [ValidatePattern('\.csv$')]
        [ValidateScript({
            Test-Path $_
        })]
        [string[]]$Path
    )
    
    $FullPath = $Path | ForEach-Object {
        (Resolve-Path $_).ProviderPath
    }
    
    $First, $Rest = $FullPath
    
    $Excel = New-Object -ComObject Excel.Application
    
    $Book = $Excel.Workbooks.Open($First)
    
    foreach ($Item in $Rest) {
        $Next = $Excel.Workbooks.Open($Item)
        $Next.ActiveSheet.Move($Book.ActiveSheet)
    }
    
    $Excel.Visible = $true
    

    You can run above script with .\ConvertTo-Excel.ps1 -Path .\services.csv, .\process.csv, ….csv
    And have all csv combined, in reversed order.

    HTH
    Bartek

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a powershell cmdlet, and I can't seem to get the parameter sets
I have a two Powershell scripts; main.ps1 and sub.ps1. main.ps1 calls sub.ps1. Sometimes sub.ps1
I have scheduled two powershell scripts as tasks to run at 00:00. This morning
Basic powershell question here - I have two computers in the c:\temp\servers.txt file and
I have a CSV file with two different columns, one with PC names and
Let's say I have a PSCrendential object in PowerShell that I created using Get-Credential
Have two folders with approx. 150 java property files. In a shell script, how
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two DropDownListBoxes one is called ddlDay and the other is ddlMonth. As
I have two application that need to talk to each other. App1 needs to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.