VMware Cloud Community
ring34
Contributor
Contributor

Clould vcenter auto generate ExportTasks.csv to specific place per day??

hello everyone,

 I should downloads ExportTasks.csv from Vcenter everyday, it is possible to scripts a .bat or cmd to assist doing daily work??

Labels (1)
  • h

0 Kudos
1 Reply
LucD
Leadership
Leadership

If you use my Get-TaskPlus function from Task Data Mining – An improved Get-Task you can do something like this

Get-TaskPlus -Start (Get-Date).AddDays(-1) -Details -Realtime |
ForEach-Object -Process {
  $_ |
  Add-Member -MemberType 'NoteProperty' -Name 'Execution Time' -Value ("{0} ms" -f [math]::Round((New-TimeSpan -Start $_.'Task Started' -End $_.'Task Ended').TotalMilliseconds, 0)) -PassThru
} | Export-Csv -Path .\ExportTasks.csv -NoTypeInformation -UseCulture

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos