Export the output of a script into a new worksheet in an exsiting file in XL


I would like to run a script several times. But each time I run it, I would like the output to be sent to an existing XL file but a new worksheet with a Title + Today’s date.

Here is my code:

$Result  |  Export-Excel -Path C:\temp\allVM.xls -WorksheetName 'Title'

Many thanks in advance.

Kind regards,


And what is your question?

You may watch this video where Doug explains a lot of stuff you can do with his module.

Sorry Olaf,

My question is how to add a today’s date to the name of the worksheet please?


If that’s all …

$Today = Get-Date -Format 'yyyy-MM-dd'
$Title = 'Title ' + $Today 
$Result  |  Export-Excel -Path C:\temp\allVM.xls -WorksheetName $Title 


You are a start…thank you…THANK YOU… and thank you again.

Have a nice evening.