boulbul
September 5, 2022, 11:11pm
1
Hi,
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,
Boulbul
Olaf
September 5, 2022, 11:12pm
2
And what is your question?
You may watch this video where Doug explains a lot of stuff you can do with his module.
boulbul
September 5, 2022, 11:13pm
3
Sorry Olaf,
My question is how to add a today’s date to the name of the worksheet please?
Thanks
Olaf
September 5, 2022, 11:16pm
4
If that’s all …
$Today = Get-Date -Format 'yyyy-MM-dd'
$Title = 'Title ' + $Today
$Result | Export-Excel -Path C:\temp\allVM.xls -WorksheetName $Title
boulbul
September 5, 2022, 11:17pm
5
Olaf,
You are a start…thank you…THANK YOU… and thank you again.
Have a nice evening.
Regards,
Boulbul